[PATCH] nvme-pci: try function level reset on init failure
Christoph Hellwig
hch at lst.de
Tue Jul 15 00:45:58 PDT 2025
On Mon, Jul 14, 2025 at 10:13:28AM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch at kernel.org>
>
> I've encountered various nvme devices that for whatever reason are stuck
> in a reset state. Historically these have required a power cycle to make
> them usable again. Vendors don't report any problem with the device when
> we ship these for analysis.
Who is the "we" here?
> In many cases, a PCIe FLR is sufficient to restart operation without a
> power cycle. Try it if controller reset fails the first time.
Why is that only done in the probe path and not the runtime reset path?
> + if (result < 0) {
> + struct pci_dev *pdev = to_pci_dev(dev->dev);
> +
> + result = pcie_flr(pdev);
> + if (result < 0)
> + return result;
> + pci_restore_state(pdev);
> +
> + result = nvme_disable_ctrl(&dev->ctrl, false);
> + if (result < 0)
> + return result;
> + }
Either way this warrants a big comment explaining what we are doing
here.
More information about the Linux-nvme
mailing list