[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210818120530.130501-2-dwagner@suse.de>
Date: Wed, 18 Aug 2021 14:05:28 +0200
From: Daniel Wagner <dwagner@...e.de>
To: linux-nvme@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org,
James Smart <james.smart@...adcom.com>,
Keith Busch <kbusch@...nel.org>,
Ming Lei <ming.lei@...hat.com>,
Sagi Grimberg <sagi@...mberg.me>,
Hannes Reinecke <hare@...e.de>,
Wen Xiong <wenxiong@...ibm.com>,
Himanshu Madhani <himanshu.madhani@...cle.com>,
Daniel Wagner <dwagner@...e.de>,
James Smart <jsmart2021@...il.com>
Subject: [PATCH v5 1/3] nvme-fc: Wait with a timeout for queue to freeze
Do not wait indifinitly for all queues to freeze. Instead use a
timeout and abort the operation if we get stuck.
Reviewed-by: James Smart <jsmart2021@...il.com>
Reviewed-by: Hannes Reinecke <hare@...e.de>
Signed-off-by: Daniel Wagner <dwagner@...e.de>
---
drivers/nvme/host/fc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 7f462af1b02a..8e59e6d142c1 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2963,7 +2963,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl)
dev_info(ctrl->ctrl.device,
"reconnect: revising io queue count from %d to %d\n",
prior_ioq_cnt, nr_io_queues);
- nvme_wait_freeze(&ctrl->ctrl);
+ if (!nvme_wait_freeze_timeout(&ctrl->ctrl, NVME_IO_TIMEOUT)) {
+ /*
+ * If we timed out waiting for freeze we are likely to
+ * be stuck. Fail the controller initialization just
+ * to be safe.
+ */
+ return -ENODEV;
+ }
blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues);
nvme_unfreeze(&ctrl->ctrl);
}
--
2.29.2
Powered by blists - more mailing lists