]> xenbits.xensource.com Git - people/aperard/linux.git/commitdiff
nvme: only set reserved_tags in nvme_alloc_io_tag_set for fabrics controllers
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Nov 2022 16:27:07 +0000 (17:27 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:20:59 +0000 (18:20 -0400)
[ Upstream commit b794d1c2ad6d7921f2867ce393815ad31b5b5a83 ]

The reserved_tags are only needed for fabrics controllers.  Right now only
fabrics drivers call this helper, so this is harmless, but we'll use it
in the PCIe driver soon.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Stable-dep-of: de105068fead ("nvme: fix reconnection fail due to reserved tag allocation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c

index 0c088db944706663c43f69db92cc8776cb14ec6d..98a8d90feb37d22b0b77cf946072847383c5c74e 100644 (file)
@@ -5029,7 +5029,8 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
        memset(set, 0, sizeof(*set));
        set->ops = ops;
        set->queue_depth = ctrl->sqsize + 1;
-       set->reserved_tags = NVMF_RESERVED_TAGS;
+       if (ctrl->ops->flags & NVME_F_FABRICS)
+               set->reserved_tags = NVMF_RESERVED_TAGS;
        set->numa_node = ctrl->numa_node;
        set->flags = BLK_MQ_F_SHOULD_MERGE;
        if (ctrl->ops->flags & NVME_F_BLOCKING)