diff options
author | Dave Jiang <dave.jiang@intel.com> | 2015-08-26 23:17:24 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-09-21 18:40:05 +0300 |
commit | ad4a7b5065c1b4f5176e7d031c3cc2b36f776884 (patch) | |
tree | febe068710e3019801c09c014d6cee2843cb24c3 /drivers/dma/ioat/init.c | |
parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) | |
download | linux-ad4a7b5065c1b4f5176e7d031c3cc2b36f776884.tar.xz |
dmaengine: ioatdma: adding shutdown support
The ioatdma needs to be queisced and block all additional op submission
during reboots. When NET_DMA was used, this caused issue as ops were still
being sent to ioatdma during reboots even though PCI BME has been turned
off. Even though NET_DMA has been deprecated, we need to prevent similar
situations. The shutdown handler should address that.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ioat/init.c')
-rw-r--r-- | drivers/dma/ioat/init.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c index 1c3c9b0abf4e..793c5dd6a0e7 100644 --- a/drivers/dma/ioat/init.c +++ b/drivers/dma/ioat/init.c @@ -1186,6 +1186,31 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca) return 0; } +static void ioat_shutdown(struct pci_dev *pdev) +{ + struct ioatdma_device *ioat_dma = pci_get_drvdata(pdev); + struct ioatdma_chan *ioat_chan; + int i; + + if (!ioat_dma) + return; + + for (i = 0; i < IOAT_MAX_CHANS; i++) { + ioat_chan = ioat_dma->idx[i]; + if (!ioat_chan) + continue; + + 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); + /* this should quiesce then reset */ + ioat_reset_hw(ioat_chan); + } + + ioat_disable_interrupts(ioat_dma); +} + #define DRV_NAME "ioatdma" static struct pci_driver ioat_pci_driver = { @@ -1193,6 +1218,7 @@ static struct pci_driver ioat_pci_driver = { .id_table = ioat_pci_tbl, .probe = ioat_pci_probe, .remove = ioat_remove, + .shutdown = ioat_shutdown, }; static struct ioatdma_device * |