Skip to content

Commit ff23a2a

Browse files
Keith Buschaxboe
authored andcommitted
NVMe: Poll device while still active during remove
A device failure or link down wouldn't have been detected during namespace removal. This patch keeps the device in the list for polling so that the thread may see such failure and initiate a reset. The device is removed from the list after disable, so we can safely flush the reset work as it can't be requeued when disable completes. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent ae1fba2 commit ff23a2a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/nvme/host/pci.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,16 +2116,12 @@ static void nvme_remove(struct pci_dev *pdev)
21162116
{
21172117
struct nvme_dev *dev = pci_get_drvdata(pdev);
21182118

2119-
spin_lock(&dev_list_lock);
2120-
list_del_init(&dev->node);
2121-
spin_unlock(&dev_list_lock);
2122-
21232119
pci_set_drvdata(pdev, NULL);
2124-
flush_work(&dev->reset_work);
21252120
flush_work(&dev->scan_work);
21262121
nvme_remove_namespaces(&dev->ctrl);
21272122
nvme_uninit_ctrl(&dev->ctrl);
21282123
nvme_dev_disable(dev, true);
2124+
flush_work(&dev->reset_work);
21292125
nvme_dev_remove_admin(dev);
21302126
nvme_free_queues(dev, 0);
21312127
nvme_release_cmb(dev);

0 commit comments

Comments
 (0)