PCI/ERR: Clear status of the reporting device

Error handling operates on the first Downstream Port above the detected
error, but the error may have been reported by a downstream device.
Clear the AER status of the device that reported the error rather than
the first Downstream Port.

Link: https://lore.kernel.org/r/20210104230300.1277180-2-kbusch@kernel.org
Tested-by: Hedi Berriche <hedi.berriche@hpe.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sean V Kelley <sean.v.kelley@intel.com>
Acked-by: Hedi Berriche <hedi.berriche@hpe.com>
This commit is contained in:
Keith Busch 2021-01-04 15:02:56 -08:00 committed by Bjorn Helgaas
parent 7c53f6b671
commit 7d7cbeaba5
1 changed files with 6 additions and 7 deletions

View File

@ -231,15 +231,14 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
pci_walk_bridge(bridge, report_resume, &status); pci_walk_bridge(bridge, report_resume, &status);
/* /*
* If we have native control of AER, clear error status in the Root * If we have native control of AER, clear error status in the device
* Port or Downstream Port that signaled the error. If the * that detected the error. If the platform retained control of AER,
* platform retained control of AER, it is responsible for clearing * it is responsible for clearing this status. In that case, the
* this status. In that case, the signaling device may not even be * signaling device may not even be visible to the OS.
* visible to the OS.
*/ */
if (host->native_aer || pcie_ports_native) { if (host->native_aer || pcie_ports_native) {
pcie_clear_device_status(bridge); pcie_clear_device_status(dev);
pci_aer_clear_nonfatal_status(bridge); pci_aer_clear_nonfatal_status(dev);
} }
pci_info(bridge, "device recovery successful\n"); pci_info(bridge, "device recovery successful\n");
return status; return status;