[PATCH] nvme-pci: Skip queue deletion if there are no queues

Keith Busch keith.busch at intel.com
Wed Mar 28 13:22:40 PDT 2018


On Wed, Mar 28, 2018 at 03:13:37PM -0500, Alex G. wrote:
> Which branch am I supposed to be using to test this? It doesn't apply to
> mainline.

This is targeted to the 4.17 staging trees (sorry, this doesn't seem to
be a good 4.16 candidate this late in the game). This should apply on
linux-block for-4.17/block here:

  https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-4.17/block

A 4.16 port would would like this:

---
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index b6f43b738f03..2459067d208b 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2194,7 +2194,7 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
 	 * Give the controller a chance to complete all entered requests if
 	 * doing a safe shutdown.
 	 */
-	if (!dead) {
+	if (!dead && dev->ctrl.queue_count > 0) {
 		if (shutdown)
 			nvme_wait_freeze_timeout(&dev->ctrl, NVME_IO_TIMEOUT);
 
--



More information about the Linux-nvme mailing list