nvme-pci: unquiesce admin queue on shutdown
authorKeith Busch <keith.busch@intel.com>
Tue, 30 Apr 2019 15:33:41 +0000 (09:33 -0600)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 May 2019 13:17:22 +0000 (09:17 -0400)
Just like IO queues, the admin queue also will not be restarted after a
controller shutdown. Unquiesce this queue so that we do not block
request dispatch on a permanently disabled controller.

Reported-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c

index 3df0f2b29427f60e375d6344cba208e2bbc87237..ac10d3ad1e754d38177bbae1f8f9134b17935d36 100644 (file)
@@ -2437,8 +2437,11 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
         * must flush all entered requests to their failed completion to avoid
         * deadlocking blk-mq hot-cpu notifier.
         */
-       if (shutdown)
+       if (shutdown) {
                nvme_start_queues(&dev->ctrl);
+               if (dev->ctrl.admin_q && !blk_queue_dying(dev->ctrl.admin_q))
+                       blk_mq_unquiesce_queue(dev->ctrl.admin_q);
+       }
        mutex_unlock(&dev->shutdown_lock);
 }