Skip to content

Commit

Permalink
nvme/pci: Disable on removal when disconnected
Browse files Browse the repository at this point in the history
commit 6db28ed upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Keith Busch authored and Greg Kroah-Hartman committed Apr 8, 2017
1 parent a5e39a7 commit 02b23e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1983,8 +1983,10 @@ static void nvme_remove(struct pci_dev *pdev)

pci_set_drvdata(pdev, NULL);

if (!pci_device_is_present(pdev))
if (!pci_device_is_present(pdev)) {
nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD);
nvme_dev_disable(dev, false);
}

flush_work(&dev->reset_work);
nvme_uninit_ctrl(&dev->ctrl);
Expand Down

0 comments on commit 02b23e0

Please sign in to comment.