Skip to contentSkip to conversation

nvme-pci: fix queue unquiesce check on slot_reset

PATCH In review Keith Busch 3 participants 6 messages Apr 24, 2025 – Apr 29, 2025 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-pci: fix queue unquiesce check on slot_reset

From: Keith Busch <[email protected]>

A zero return means the reset was successfully scheduled. We don't want to unquiesce the queues while the reset_work is pending, as that will just flush out requeued requests to a failed completion.

Fixes 71a5bb153be104 ("nvme: ensure disabling pairs with unquiesce")
---
 drivers/nvme/host/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/pci.c +1 -1
index b178d52eac1b7..c9e2a5450bc0f 100644
@@ -3575,7 +3575,7 @@ static pci_ers_result_t nvme_slot_reset(struct pci_dev *pdev)
 
 	dev_info(dev->ctrl.device, "restart after slot reset\n");
 	pci_restore_state(pdev);
-	if (!nvme_try_sched_reset(&dev->ctrl))
+	if (nvme_try_sched_reset(&dev->ctrl))
 		nvme_unquiesce_io_queues(&dev->ctrl);
 	return PCI_ERS_RESULT_RECOVERED;
 }
Signature · 1 line
2.47.1
#1 lore raw
Quoted 7 lines · Keith Busch

From: Keith Busch <[email protected]>

A zero return means the reset was successfully scheduled. We don't want to unquiesce the queues while the reset_work is pending, as that will just flush out requeued requests to a failed completion.

Fixes 71a5bb153be104 ("nvme: ensure disabling pairs with unquiesce")

Sounds like this code path isn't get teste all the much if this stuck around for so long..

maintainer
#2 lore raw
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · Keith Busch

From: Keith Busch <[email protected]>

A zero return means the reset was successfully scheduled. We don't want to unquiesce the queues while the reset_work is pending, as that will just flush out requeued requests to a failed completion.

Fixes 71a5bb153be104 ("nvme: ensure disabling pairs with unquiesce")

Sounds like this code path isn't get teste all the much if this stuck around for so long..

The conditions that trigger pcie errors were the primary concern. Of course you'll get IO errors, right? The pcie connection is flakey! But we are supposed retry IO's after recovery, which we weren't doing, and that was a secondary concern I embaressingly overlooked for many reports.

maintainer
#3 lore raw
Quoted 10 lines · Keith Busch
Quoted 9 lines · Christoph Hellwig
Quoted 7 lines · Keith Busch

From: Keith Busch <[email protected]>

A zero return means the reset was successfully scheduled. We don't want to unquiesce the queues while the reset_work is pending, as that will just flush out requeued requests to a failed completion.

Fixes 71a5bb153be104 ("nvme: ensure disabling pairs with unquiesce")
Quoted 8 lines
Quoted 2 lines

Sounds like this code path isn't get teste all the much if this stuck around for so long..

The conditions that trigger pcie errors were the primary concern. Of course you'll get IO errors, right? The pcie connection is flakey! But we are supposed retry IO's after recovery, which we weren't doing, and that was a secondary concern I embaressingly overlooked for many reports.

We can still take this right? It is a good fix, even if we misunderstood why IO was failing for over a year there.

#4 lore raw
Quoted 10 lines · Keith Busch
Quoted 8 lines
Quoted 2 lines

Sounds like this code path isn't get teste all the much if this stuck around for so long..

The conditions that trigger pcie errors were the primary concern. Of course you'll get IO errors, right? The pcie connection is flakey! But we are supposed retry IO's after recovery, which we weren't doing, and that was a secondary concern I embaressingly overlooked for many reports.

We can still take this right?

Absolutely. Just wondering how this managed to slip through.