PCI/AER: Continue AER recovery of device with NO_BUS_RESET set
Subsystems (2)
PATCH 1/1 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.
--- drivers/pci/pcie/aer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/pci/pcie/aer.c +6 -2
@@ -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) {
Signature · 1 line
2.25.1
Quoted 5 lines · Shanker Donthineni
External email: Use caution opening links or attachments
In the current implementation, the AER FATAL and NONFTAL recovery will be terminated for the device that exhibits
NO_BUS_RESETquirk. The non-zero
Correction, this problem happens only for AER_FATAL recovery case.
Quoted 51 lines
return value from
pci_bus_error_reset()is treated as an error condition inaer_root_reset()which leads to returnPCI_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
-ENOTTYfrompci_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 <[email protected]>--- drivers/pci/pcie/aer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/pci/pcie/aer.c +6
-3@@ -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