My Western Digital SN850 appears to suffer from deep power state issues - considering submitting quirk patch.

Keith Busch kbusch at kernel.org
Sun May 15 13:13:26 PDT 2022


On Sun, May 15, 2022 at 01:44:32PM -0600, Keith Busch wrote:
> There might be additional things we could do at the PCIe level, like a slot
> reset on the downstream port, but I haven't seen evidence that type of
> escalation improves anything so far. It might be worth a shot, though.

Something like this:

---
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1392,6 +1392,15 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
 	if (nvme_should_reset(dev, csts)) {
 		nvme_warn_reset(dev, csts);
 		nvme_dev_disable(dev, false);
+
+		if (csts == 0xffffffff) {
+			struct pci_dev *parent = to_pci_dev(dev->dev)->bus->self;
+
+			dev_warn(dev->ctrl.device, "link is inaccessible, attempt reset bus:%x\n",
+				parent->subordinate->number);
+			pci_reset_bus(parent);
+		}
+
 		nvme_reset_ctrl(&dev->ctrl);
 		return BLK_EH_DONE;
 	}
--



More information about the Linux-nvme mailing list