aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2017-02-10 18:15:49 -0500
committerJens Axboe <axboe@fb.com>2017-02-22 15:34:00 -0500
commit6db28eda266052f86a6b402422de61eeb7d2e351 (patch)
tree170deac146c635873dcbee3e77ccd810830002f8
parentc5552fde102fcc3f2cf9e502b8ac90e3500d8fdf (diff)
nvme/pci: Disable on removal when disconnected
If the device is not present, the driver should disable the queues immediately. Prior to this, the driver was relying on the watchdog timer to kill the queues if requests were outstanding to the device, and that just delays removal up to one second. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/nvme/host/pci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ddc51adb594d..362a1468f99d 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2001,8 +2001,10 @@ static void nvme_remove(struct pci_dev *pdev)
2001 2001
2002 pci_set_drvdata(pdev, NULL); 2002 pci_set_drvdata(pdev, NULL);
2003 2003
2004 if (!pci_device_is_present(pdev)) 2004 if (!pci_device_is_present(pdev)) {
2005 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD); 2005 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD);
2006 nvme_dev_disable(dev, false);
2007 }
2006 2008
2007 flush_work(&dev->reset_work); 2009 flush_work(&dev->reset_work);
2008 nvme_uninit_ctrl(&dev->ctrl); 2010 nvme_uninit_ctrl(&dev->ctrl);