nvme: sync timeout work on failed reset
authorKeith Busch <kbusch@kernel.org>
Wed, 28 Jun 2023 14:48:15 +0000 (07:48 -0700)
committerKeith Busch <kbusch@kernel.org>
Fri, 30 Jun 2023 17:48:15 +0000 (10:48 -0700)
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 to ensure we don't have any other tasks
messing with any namespace request_queue's.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/pci.c

index 8eaa954aa6ed4fb376e9f773b0beebab9edf2fad..bfeadecf9e15b313775454ef94be969e0109e4b1 100644 (file)
@@ -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);