]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.1/nvme-only-set-reserved_tags-in-nvme_alloc_io_tag_set.patch
Linux 6.6.23
[thirdparty/kernel/stable-queue.git] / queue-6.1 / nvme-only-set-reserved_tags-in-nvme_alloc_io_tag_set.patch
1 From d55095432bc46b61b996d3a447fd093c55470ba8 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Wed, 30 Nov 2022 17:27:07 +0100
4 Subject: nvme: only set reserved_tags in nvme_alloc_io_tag_set for fabrics
5 controllers
6
7 From: Christoph Hellwig <hch@lst.de>
8
9 [ Upstream commit b794d1c2ad6d7921f2867ce393815ad31b5b5a83 ]
10
11 The reserved_tags are only needed for fabrics controllers. Right now only
12 fabrics drivers call this helper, so this is harmless, but we'll use it
13 in the PCIe driver soon.
14
15 Signed-off-by: Christoph Hellwig <hch@lst.de>
16 Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
17 Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
18 Stable-dep-of: de105068fead ("nvme: fix reconnection fail due to reserved tag allocation")
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 ---
21 drivers/nvme/host/core.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24 diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
25 index 0c088db944706..98a8d90feb37d 100644
26 --- a/drivers/nvme/host/core.c
27 +++ b/drivers/nvme/host/core.c
28 @@ -5029,7 +5029,8 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
29 memset(set, 0, sizeof(*set));
30 set->ops = ops;
31 set->queue_depth = ctrl->sqsize + 1;
32 - set->reserved_tags = NVMF_RESERVED_TAGS;
33 + if (ctrl->ops->flags & NVME_F_FABRICS)
34 + set->reserved_tags = NVMF_RESERVED_TAGS;
35 set->numa_node = ctrl->numa_node;
36 set->flags = BLK_MQ_F_SHOULD_MERGE;
37 if (ctrl->ops->flags & NVME_F_BLOCKING)
38 --
39 2.43.0
40