Skip to content

Commit ebef736

Browse files
Keith Buschaxboe
authored andcommitted
nvme/pci: Fix stuck nvme reset
The controller state is set to resetting prior to disabling the controller, so this patch accounts for that state when deciding if it needs to freeze the queues. Without this, an 'nvme reset /dev/nvme0' blocks forever because the queues were never frozen. Fixes: 82b057c ("nvme-pci: fix multiple ctrl removal scheduling") Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3c2bfba commit ebef736

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/host/pci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,8 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
18051805
if (pci_is_enabled(pdev)) {
18061806
u32 csts = readl(dev->bar + NVME_REG_CSTS);
18071807

1808-
if (dev->ctrl.state == NVME_CTRL_LIVE)
1808+
if (dev->ctrl.state == NVME_CTRL_LIVE ||
1809+
dev->ctrl.state == NVME_CTRL_RESETTING)
18091810
nvme_start_freeze(&dev->ctrl);
18101811
dead = !!((csts & NVME_CSTS_CFS) || !(csts & NVME_CSTS_RDY) ||
18111812
pdev->error_state != pci_channel_io_normal);

0 commit comments

Comments
 (0)