Merge tag 'pci-v4.20-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[sfrench/cifs-2.6.git] / drivers / dma / ioat / init.c
index 4fa4c06c9edb9809675ea98a2d058e3c8b5dfa35..2d810dfcdc484ea18eac117a47f074a97b40c456 100644 (file)
@@ -129,7 +129,7 @@ static void
 ioat_init_channel(struct ioatdma_device *ioat_dma,
                  struct ioatdma_chan *ioat_chan, int idx);
 static void ioat_intr_quirk(struct ioatdma_device *ioat_dma);
-static int ioat_enumerate_channels(struct ioatdma_device *ioat_dma);
+static void ioat_enumerate_channels(struct ioatdma_device *ioat_dma);
 static int ioat3_dma_self_test(struct ioatdma_device *ioat_dma);
 
 static int ioat_dca_enabled = 1;
@@ -575,7 +575,7 @@ static void ioat_dma_remove(struct ioatdma_device *ioat_dma)
  * ioat_enumerate_channels - find and initialize the device's channels
  * @ioat_dma: the ioat dma device to be enumerated
  */
-static int ioat_enumerate_channels(struct ioatdma_device *ioat_dma)
+static void ioat_enumerate_channels(struct ioatdma_device *ioat_dma)
 {
        struct ioatdma_chan *ioat_chan;
        struct device *dev = &ioat_dma->pdev->dev;
@@ -594,7 +594,7 @@ static int ioat_enumerate_channels(struct ioatdma_device *ioat_dma)
        xfercap_log = readb(ioat_dma->reg_base + IOAT_XFERCAP_OFFSET);
        xfercap_log &= 0x1f; /* bits [4:0] valid */
        if (xfercap_log == 0)
-               return 0;
+               return;
        dev_dbg(dev, "%s: xfercap = %d\n", __func__, 1 << xfercap_log);
 
        for (i = 0; i < dma->chancnt; i++) {
@@ -611,7 +611,6 @@ static int ioat_enumerate_channels(struct ioatdma_device *ioat_dma)
                }
        }
        dma->chancnt = i;
-       return i;
 }
 
 /**
@@ -1205,8 +1204,15 @@ static void ioat_shutdown(struct pci_dev *pdev)
 
                spin_lock_bh(&ioat_chan->prep_lock);
                set_bit(IOAT_CHAN_DOWN, &ioat_chan->state);
-               del_timer_sync(&ioat_chan->timer);
                spin_unlock_bh(&ioat_chan->prep_lock);
+               /*
+                * Synchronization rule for del_timer_sync():
+                *  - The caller must not hold locks which would prevent
+                *    completion of the timer's handler.
+                * So prep_lock cannot be held before calling it.
+                */
+               del_timer_sync(&ioat_chan->timer);
+
                /* this should quiesce then reset */
                ioat_reset_hw(ioat_chan);
        }
@@ -1252,7 +1258,6 @@ static pci_ers_result_t ioat_pcie_error_detected(struct pci_dev *pdev,
 static pci_ers_result_t ioat_pcie_error_slot_reset(struct pci_dev *pdev)
 {
        pci_ers_result_t result = PCI_ERS_RESULT_RECOVERED;
-       int err;
 
        dev_dbg(&pdev->dev, "%s post reset handling\n", DRV_NAME);
 
@@ -1267,12 +1272,6 @@ static pci_ers_result_t ioat_pcie_error_slot_reset(struct pci_dev *pdev)
                pci_wake_from_d3(pdev, false);
        }
 
-       err = pci_cleanup_aer_uncorrect_error_status(pdev);
-       if (err) {
-               dev_err(&pdev->dev,
-                       "AER uncorrect error status clear failed: %#x\n", err);
-       }
-
        return result;
 }