nvme-pci: unquiesce admin queue on shutdown
authorKeith Busch <keith.busch@intel.com>
Tue, 30 Apr 2019 15:33:41 +0000 (09:33 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:54:54 +0000 (11:54 +0200)
[ Upstream commit c8e9e9b7646ebe1c5066ddc420d7630876277eb4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c

index 06355ca832db5b3a1c3a7112ee10f85d7ad01a4c..cd11cced3678168a0a96ba0249d57ce096c97131 100644 (file)
@@ -2105,8 +2105,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);
 }