From: Ming Lei Date: Tue, 9 Nov 2021 07:11:44 +0000 (+0800) Subject: nvme: wait until quiesce is done X-Git-Tag: v6.1-rc5~2683^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26af1cd00364ce20dbec66b93ef42f9d42dc6953;p=platform%2Fkernel%2Flinux-starfive.git nvme: wait until quiesce is done NVMe uses one atomic flag to check if quiesce is needed. If quiesce is started, the helper returns immediately. This way is wrong, since we have to wait until quiesce is done. Fixes: e70feb8b3e68 ("blk-mq: support concurrent queue quiesce/unquiesce") Reviewed-by: Keith Busch Signed-off-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211109071144.181581-5-ming.lei@redhat.com Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index eb284f4..2fc5ea9 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4476,6 +4476,8 @@ static void nvme_stop_ns_queue(struct nvme_ns *ns) { if (!test_and_set_bit(NVME_NS_STOPPED, &ns->flags)) blk_mq_quiesce_queue(ns->queue); + else + blk_mq_wait_quiesce_done(ns->queue); } /* @@ -4595,6 +4597,8 @@ void nvme_stop_admin_queue(struct nvme_ctrl *ctrl) { if (!test_and_set_bit(NVME_CTRL_ADMIN_Q_STOPPED, &ctrl->flags)) blk_mq_quiesce_queue(ctrl->admin_q); + else + blk_mq_wait_quiesce_done(ctrl->admin_q); } EXPORT_SYMBOL_GPL(nvme_stop_admin_queue);