From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Daniel Wagner <dwagner@suse.de>, Ming Lei <ming.lei@redhat.com>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
Hannes Reinecke <hare@suse.de>,
James Smart <jsmart2021@gmail.com>,
Christoph Hellwig <hch@lst.de>, Sasha Levin <sashal@kernel.org>,
james.smart@broadcom.com, kbusch@kernel.org, axboe@fb.com,
Christoph@vger.kernel.org, sagi@grimberg.me,
linux-nvme@lists.infradead.org
Subject: [PATCH AUTOSEL 5.10 17/23] nvme-fc: update hardware queues before using them
Date: Tue, 28 Sep 2021 01:56:38 -0400 [thread overview]
Message-ID: <20210928055645.172544-17-sashal@kernel.org> (raw)
In-Reply-To: <20210928055645.172544-1-sashal@kernel.org>
From: Daniel Wagner <dwagner@suse.de>
[ Upstream commit 555f66d0f8a38537456acc77043d0e4469fcbe8e ]
In case the number of hardware queues changes, we need to update the
tagset and the mapping of ctx to hctx first.
If we try to create and connect the I/O queues first, this operation
will fail (target will reject the connect call due to the wrong number
of queues) and hence we bail out of the recreate function. Then we
will to try the very same operation again, thus we don't make any
progress.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/fc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index a0bcec33b020..86c6862e71a1 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2952,14 +2952,6 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
if (ctrl->ctrl.queue_count == 1)
return 0;
- ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
- if (ret)
- goto out_free_io_queues;
-
- ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
- if (ret)
- goto out_delete_hw_queues;
-
if (prior_ioq_cnt != nr_io_queues) {
dev_info(ctrl->ctrl.device,
"reconnect: revising io queue count from %d to %d\n",
@@ -2969,6 +2961,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
nvme_unfreeze(&ctrl->ctrl);
}
+ ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
+ if (ret)
+ goto out_free_io_queues;
+
+ ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1);
+ if (ret)
+ goto out_delete_hw_queues;
+
return 0;
out_delete_hw_queues:
--
2.33.0
next prev parent reply other threads:[~2021-09-28 5:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 5:56 [PATCH AUTOSEL 5.10 01/23] spi: rockchip: handle zero length transfers without timing out Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 02/23] platform/x86: touchscreen_dmi: Add info for the Chuwi HiBook (CWI514) tablet Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 03/23] platform/x86: touchscreen_dmi: Update info for the Chuwi Hi10 Plus (CWI527) tablet Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 04/23] nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 05/23] btrfs: replace BUG_ON() in btrfs_csum_one_bio() with proper error handling Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 06/23] btrfs: fix mount failure due to past and transient device flush error Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 07/23] net: mdio: introduce a shutdown method to mdio device drivers Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 08/23] xen-netback: correct success/error reporting for the SKB-with-fraglist case Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 09/23] sparc64: fix pci_iounmap() when CONFIG_PCI is not set Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 10/23] ext2: fix sleeping in atomic bugs on error Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 11/23] scsi: sd: Free scsi_disk device via put_device() Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 12/23] usb: testusb: Fix for showing the connection speed Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 13/23] usb: dwc2: check return value after calling platform_get_resource() Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 14/23] habanalabs/gaudi: fix LBW RR configuration Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 15/23] selftests: be sure to make khdr before other targets Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 16/23] selftests:kvm: fix get_warnings_count() ignoring fscanf() return warn Sasha Levin
2021-09-28 5:56 ` Sasha Levin [this message]
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 18/23] nvme-fc: avoid race between time out and tear down Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 19/23] thermal/drivers/tsens: Fix wrong check for tzd in irq handlers Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 20/23] scsi: ses: Retry failed Send/Receive Diagnostic commands Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 21/23] irqchip/gic: Work around broken Renesas integration Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 22/23] smb3: correct smb3 ACL security descriptor Sasha Levin
2021-09-28 5:56 ` [PATCH AUTOSEL 5.10 23/23] tools/vm/page-types: remove dependency on opt_file for idle page tracking Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210928055645.172544-17-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Christoph@vger.kernel.org \
--cc=axboe@fb.com \
--cc=dwagner@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=himanshu.madhani@oracle.com \
--cc=james.smart@broadcom.com \
--cc=jsmart2021@gmail.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=ming.lei@redhat.com \
--cc=sagi@grimberg.me \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox