From be854c03b048c25cd8cebe6e1d0c366b9d49f40c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 26 Feb 2024 13:11:29 -0500 Subject: [PATCH] nvme-fc: initialize max_hw_sectors earlier Initialize max_hw_sectors and max_sectors a little earlier so that nvme_alloc_admin_tag_set can rely on it to set the initial queue limits. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/fc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 68a5d971657b..537008dd2c61 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -3113,10 +3113,6 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) if (ret) goto out_disconnect_admin_queue; - ctrl->ctrl.max_segments = ctrl->lport->ops->max_sgl_segments; - ctrl->ctrl.max_hw_sectors = ctrl->ctrl.max_segments << - (ilog2(SZ_4K) - 9); - nvme_unquiesce_admin_queue(&ctrl->ctrl); ret = nvme_init_ctrl_finish(&ctrl->ctrl, false); @@ -3542,6 +3538,10 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, /* at this point, teardown path changes to ref counting on nvme ctrl */ + ctrl->ctrl.max_segments = ctrl->lport->ops->max_sgl_segments; + ctrl->ctrl.max_hw_sectors = + ctrl->ctrl.max_segments << (ilog2(SZ_4K) - 9); + ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set, &nvme_fc_admin_mq_ops, struct_size_t(struct nvme_fcp_op_w_sgl, priv, -- 2.50.1