Skip to content

Commit 6b6f6c4

Browse files
Ming Leiaxboe
authored andcommitted
nvme: core: switch to non_owner variant of start_freeze/unfreeze queue
nvme_start_freeze() and nvme_unfreeze() may be called from same context, so switch them to call non_owner variant of start_freeze/unfreeze queue. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20241025003722.3630252-3-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 8acdd0e commit 6b6f6c4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/nvme/host/core.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4864,7 +4864,7 @@ void nvme_unfreeze(struct nvme_ctrl *ctrl)
48644864

48654865
srcu_idx = srcu_read_lock(&ctrl->srcu);
48664866
list_for_each_entry_rcu(ns, &ctrl->namespaces, list)
4867-
blk_mq_unfreeze_queue(ns->queue);
4867+
blk_mq_unfreeze_queue_non_owner(ns->queue);
48684868
srcu_read_unlock(&ctrl->srcu, srcu_idx);
48694869
clear_bit(NVME_CTRL_FROZEN, &ctrl->flags);
48704870
}
@@ -4906,7 +4906,12 @@ void nvme_start_freeze(struct nvme_ctrl *ctrl)
49064906
set_bit(NVME_CTRL_FROZEN, &ctrl->flags);
49074907
srcu_idx = srcu_read_lock(&ctrl->srcu);
49084908
list_for_each_entry_rcu(ns, &ctrl->namespaces, list)
4909-
blk_freeze_queue_start(ns->queue);
4909+
/*
4910+
* Typical non_owner use case is from pci driver, in which
4911+
* start_freeze is called from timeout work function, but
4912+
* unfreeze is done in reset work context
4913+
*/
4914+
blk_freeze_queue_start_non_owner(ns->queue);
49104915
srcu_read_unlock(&ctrl->srcu, srcu_idx);
49114916
}
49124917
EXPORT_SYMBOL_GPL(nvme_start_freeze);

0 commit comments

Comments
 (0)