* [PATCH 1/3] nvme: ensure unquiesce on teardown
@ 2023-06-28 14:58 Keith Busch
2023-06-28 14:58 ` [PATCH 2/3] nvme: sync timeout work on failed reset Keith Busch
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Keith Busch @ 2023-06-28 14:58 UTC (permalink / raw)
To: linux-nvme, hch, sagi, ming.lei; +Cc: brookxu.cn, Keith Busch
From: Keith Busch <kbusch@kernel.org>
The reset work is called on quiesced IO queues, so ensure these are
unquiesced after a failed reset to flush out any pending requests.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index b027e5e3f4acb..8eaa954aa6ed4 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2778,6 +2778,7 @@ static void nvme_reset_work(struct work_struct *work)
nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);
nvme_dev_disable(dev, true);
nvme_mark_namespaces_dead(&dev->ctrl);
+ nvme_unquiesce_io_queues(&dev->ctrl);
nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] nvme: sync timeout work on failed reset
2023-06-28 14:58 [PATCH 1/3] nvme: ensure unquiesce on teardown Keith Busch
@ 2023-06-28 14:58 ` Keith Busch
2023-06-29 5:22 ` Christoph Hellwig
2023-06-28 14:58 ` [PATCH 3/3] nvme: disable controller on reset state failure Keith Busch
2023-06-29 5:22 ` [PATCH 1/3] nvme: ensure unquiesce on teardown Christoph Hellwig
2 siblings, 1 reply; 6+ messages in thread
From: Keith Busch @ 2023-06-28 14:58 UTC (permalink / raw)
To: linux-nvme, hch, sagi, ming.lei; +Cc: brookxu.cn, Keith Busch
From: Keith Busch <kbusch@kernel.org>
Timeouts during reset will set the controller for failure, preventing
the state change to LIVE. Ensure all timeout work is synced after the
controller disabling completes so we don't have any other tasks messing
with any namespace request_queues.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 8eaa954aa6ed4..bfeadecf9e15b 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2777,6 +2777,7 @@ static void nvme_reset_work(struct work_struct *work)
result);
nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);
nvme_dev_disable(dev, true);
+ nvme_sync_queues(&dev->ctrl);
nvme_mark_namespaces_dead(&dev->ctrl);
nvme_unquiesce_io_queues(&dev->ctrl);
nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DEAD);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] nvme: disable controller on reset state failure
2023-06-28 14:58 [PATCH 1/3] nvme: ensure unquiesce on teardown Keith Busch
2023-06-28 14:58 ` [PATCH 2/3] nvme: sync timeout work on failed reset Keith Busch
@ 2023-06-28 14:58 ` Keith Busch
2023-06-29 5:23 ` Christoph Hellwig
2023-06-29 5:22 ` [PATCH 1/3] nvme: ensure unquiesce on teardown Christoph Hellwig
2 siblings, 1 reply; 6+ messages in thread
From: Keith Busch @ 2023-06-28 14:58 UTC (permalink / raw)
To: linux-nvme, hch, sagi, ming.lei; +Cc: brookxu.cn, Keith Busch
From: Keith Busch <kbusch@kernel.org>
If the controller is not in a RESETTING state at the point of reset
work, we have to conclude the controller is being deleted. Go to the
cleanup on this condition to ensure proper pairing of request_queue
quiesce state.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index bfeadecf9e15b..c9224d39195e5 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2690,7 +2690,8 @@ static void nvme_reset_work(struct work_struct *work)
if (dev->ctrl.state != NVME_CTRL_RESETTING) {
dev_warn(dev->ctrl.device, "ctrl state %d is not RESETTING\n",
dev->ctrl.state);
- return;
+ result = -ENODEV;
+ goto out;
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] nvme: ensure unquiesce on teardown
2023-06-28 14:58 [PATCH 1/3] nvme: ensure unquiesce on teardown Keith Busch
2023-06-28 14:58 ` [PATCH 2/3] nvme: sync timeout work on failed reset Keith Busch
2023-06-28 14:58 ` [PATCH 3/3] nvme: disable controller on reset state failure Keith Busch
@ 2023-06-29 5:22 ` Christoph Hellwig
2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2023-06-29 5:22 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-nvme, hch, sagi, ming.lei, brookxu.cn, Keith Busch
On Wed, Jun 28, 2023 at 07:58:12AM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> The reset work is called on quiesced IO queues, so ensure these are
> unquiesced after a failed reset to flush out any pending requests.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] nvme: sync timeout work on failed reset
2023-06-28 14:58 ` [PATCH 2/3] nvme: sync timeout work on failed reset Keith Busch
@ 2023-06-29 5:22 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2023-06-29 5:22 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-nvme, hch, sagi, ming.lei, brookxu.cn, Keith Busch
On Wed, Jun 28, 2023 at 07:58:13AM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Timeouts during reset will set the controller for failure, preventing
> the state change to LIVE. Ensure all timeout work is synced after the
> controller disabling completes so we don't have any other tasks messing
> with any namespace request_queues.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] nvme: disable controller on reset state failure
2023-06-28 14:58 ` [PATCH 3/3] nvme: disable controller on reset state failure Keith Busch
@ 2023-06-29 5:23 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2023-06-29 5:23 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-nvme, hch, sagi, ming.lei, brookxu.cn, Keith Busch
On Wed, Jun 28, 2023 at 07:58:14AM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> If the controller is not in a RESETTING state at the point of reset
> work, we have to conclude the controller is being deleted. Go to the
> cleanup on this condition to ensure proper pairing of request_queue
> quiesce state.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-29 5:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-28 14:58 [PATCH 1/3] nvme: ensure unquiesce on teardown Keith Busch
2023-06-28 14:58 ` [PATCH 2/3] nvme: sync timeout work on failed reset Keith Busch
2023-06-29 5:22 ` Christoph Hellwig
2023-06-28 14:58 ` [PATCH 3/3] nvme: disable controller on reset state failure Keith Busch
2023-06-29 5:23 ` Christoph Hellwig
2023-06-29 5:22 ` [PATCH 1/3] nvme: ensure unquiesce on teardown Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox