]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/nvme/host/pci.c
NVMe: Short-cut removal on surprise hot-unplug
[mirror_ubuntu-artful-kernel.git] / drivers / nvme / host / pci.c
index 4feaed591e836aca8cef1bf17c5275028a9fbf7d..3bdcf0e34fd6d736444b4d95b36b7f14c34763e0 100644 (file)
@@ -2017,6 +2017,10 @@ static void nvme_remove(struct pci_dev *pdev)
        nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);
 
        pci_set_drvdata(pdev, NULL);
+
+       if (!pci_device_is_present(pdev))
+               nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD);
+
        flush_work(&dev->reset_work);
        nvme_uninit_ctrl(&dev->ctrl);
        nvme_dev_disable(dev, true);