diff mbox series

PCI: Clear AER uncorrectable status according to error types

Message ID TY3P286MB2754DE49E4D1CB87C9256D21B4D62@TY3P286MB2754.JPNP286.PROD.OUTLOOK.COM (mailing list archive)
State New
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Clear AER uncorrectable status according to error types | expand

Commit Message

Songyang Li June 26, 2024, 3:32 p.m. UTC
The AER recovery process use pci_aer_clear_nonfatal_status() to clear
non-fatal error status after successfully recovering from non-fatal error.
However, the fatal error status clearing for successful recovery of AER
fatal error was overlooked.
Therefore, this patch wants:
When the error type is non-fatal, use pci_aer_clear_nonfatal_status()
to clear non-fatal error status.
When the error type is fatal, use pci_aer_clear_fatal_status()
to clear fatal error status.

Signed-off-by: Songyang Li <leesongyang@outlook.com>
---
 drivers/pci/pcie/err.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 drivers/pci/pcie/err.c
diff mbox series

Patch

diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
old mode 100644
new mode 100755
index 31090770fffc..14e1e0daecb8
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -258,7 +258,10 @@  pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
 	 */
 	if (host->native_aer || pcie_ports_native) {
 		pcie_clear_device_status(dev);
-		pci_aer_clear_nonfatal_status(dev);
+		if (state == pci_channel_io_normal)
+			pci_aer_clear_nonfatal_status(dev);
+		else if (state == pci_channel_io_frozen)
+			pci_aer_clear_fatal_status(dev);
 	}
 
 	pci_walk_bridge(bridge, pci_pm_runtime_put, NULL);