[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210821133058.31583-1-sdonthineni@nvidia.com>
Date: Sat, 21 Aug 2021 08:30:58 -0500
From: Shanker Donthineni <sdonthineni@...dia.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
CC: Alex Williamson <alex.williamson@...hat.com>,
<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linuxppc-dev@...ts.ozlabs.org>,
"Oliver O'Halloran" <oohall@...il.com>,
Russell Currey <ruscur@...sell.cc>,
"Shanker Donthineni" <sdonthineni@...dia.com>
Subject: [PATCH] PCI/AER: Continue AER recovery of device with NO_BUS_RESET set
In the current implementation, the AER FATAL and NONFTAL recovery will be
terminated for the device that exhibits NO_BUS_RESET quirk. The non-zero
return value from pci_bus_error_reset() is treated as an error condition
in aer_root_reset() which leads to return PCI_ERS_RESULT_DISCONNECT.
aer_recover_work_func()
pcie_do_recovery()
report_frozen_detected()
if (aer_root_reset() == PCI_ERS_RESULT_DISCONNECT)
goto failed # termimates here because of NO_BUS_RESET
...
report_mmio_enabled()
report_resume()
pcie_clear_xxx_status()
...
return 0
failed:
pci_uevent_ers(PCI_ERS_RESULT_DISCONNECT);
The return value -ENOTTY from pci_bus_error_reset() indicates SBR was
skipped but no real errors were encountered. This scenario could be
considered as a non-error case so that the PCI device driver gets the
opportunity to recover the device back to an operational state instead
of keeping it in the DISCONNECT state.
Signed-off-by: Shanker Donthineni <sdonthineni@...dia.com>
---
drivers/pci/pcie/aer.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 9784fdcf30061..8cf6bd6a3376d 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1414,8 +1414,12 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
pci_info(dev, "not reset (no FLR support: %d)\n", rc);
} else {
rc = pci_bus_error_reset(dev);
- pci_info(dev, "%s Port link has been reset (%d)\n",
- pci_is_root_bus(dev->bus) ? "Root" : "Downstream", rc);
+ pci_info(dev, "%s Port link has %sbeen reset (%d)\n",
+ pci_is_root_bus(dev->bus) ? "Root" : "Downstream",
+ rc == -ENOTTY ? "not " : "", rc);
+
+ if (rc == -ENOTTY)
+ rc = 0;
}
if ((host->native_aer || pcie_ports_native) && aer) {
--
2.25.1
Powered by blists - more mailing lists