From: Keith Busch Date: Fri, 10 Feb 2017 23:15:49 +0000 (-0500) Subject: nvme/pci: Disable on removal when disconnected X-Git-Tag: v4.9.21~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02b23e059a9d4b862ea97c6f425a147c7780f212;p=platform%2Fkernel%2Flinux-amlogic.git nvme/pci: Disable on removal when disconnected commit 6db28eda266052f86a6b402422de61eeb7d2e351 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 Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 5e52034..8a9c186 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -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);