nvme: ensure unquiesce on teardown
PATCH 1/3 nvme: ensure unquiesce on teardown
From: Keith Busch <[email protected]>
The reset work is called on quiesced IO queues, so ensure these are unquiesced after a failed reset to flush out any pending requests.
--- drivers/nvme/host/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
@@ -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 ); }
Signature · 1 line
2.34.1
PATCH 2/3 nvme: sync timeout work on failed reset
From: Keith Busch <[email protected]>
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.
--- drivers/nvme/host/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
@@ -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 );
Signature · 1 line
2.34.1
Re: [PATCH 2/3] nvme: sync timeout work on failed reset
Quoted 6 lines · Keith Busch
From: Keith Busch <[email protected]>
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:
PATCH 3/3 nvme: disable controller on reset state failure
In reply to Keith BuschFrom: Keith Busch <[email protected]>
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.
--- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -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; }/*
Signature · 1 line
2.34.1
Re: [PATCH 3/3] nvme: disable controller on reset state failure
Quoted 6 lines · Keith Busch
From: Keith Busch <[email protected]>
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_queuequiesce state.
Looks good:
Quoted 4 lines · Keith Busch
From: Keith Busch <[email protected]>
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: