Return-Path: Received: from mga01.intel.com ([192.55.52.88]:42484 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752949AbdDDTr0 (ORCPT ); Tue, 4 Apr 2017 15:47:26 -0400 From: Keith Busch To: stable@vger.kernel.org Cc: Keith Busch , Sagi Grimberg , Jens Axboe Subject: [PATCH 2/2] nvme/pci: Disable on removal when disconnected Date: Tue, 4 Apr 2017 15:55:30 -0400 Message-Id: <1491335730-10784-2-git-send-email-keith.busch@intel.com> In-Reply-To: <1491335730-10784-1-git-send-email-keith.busch@intel.com> References: <1491335730-10784-1-git-send-email-keith.busch@intel.com> Sender: stable-owner@vger.kernel.org List-ID: 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. Cc: # 4.9+ Signed-off-by: Keith Busch Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe --- drivers/nvme/host/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.5.5