public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI/ERR: Clear fatal status of the reporting device
@ 2026-02-27 10:25 Sizhe Liu
  2026-02-27 16:31 ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Sizhe Liu @ 2026-02-27 10:25 UTC (permalink / raw)
  To: bhelgaas, jonathan.cameron, shiju.jose, keith.busch
  Cc: linux-pci, linuxarm, prime.zeng, fanghao11, shenyang39, liusizhe5

During PCIe native AER error recovery, ERR_FATAL status bits are not cleared
after fatal error handling. This causes stale ERR_FATAL bits to be reported
in subsequent AER events, even after reporting "device recovery successful".

Prior to commit bdb5ac85777d ("PCI/ERR: Handle fatal error recovery"), native
AER handled non-fatal and fatal errors separately, clearing the corresponding
status bits for both types after processing. That commit unified the error
paths through pcie_do_recovery(), which began invoking
pci_cleanup_aer_uncorrect_error_status() after commit bfcb79fca19d
("PCI/ERR: Run error recovery callbacks for all affected devices").

This function only clears non-fatal error (NFE) bits and leaves ERR_FATAL
bits uncleared, resulting in stale error status.

Fix this by explicitly clearing the ERR_FATAL status bits for the reporting
device during recovery, restoring the original fatal error handling behavior.

Signed-off-by: Sizhe Liu <liusizhe5@huawei.com>
---
 drivers/pci/pcie/err.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
index bebe4bc111d7..f51225f2592d 100644
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -281,6 +281,7 @@ 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);
+		pci_aer_clear_fatal_status(dev);
 	}
 
 	pci_walk_bridge(bridge, pci_pm_runtime_put, NULL);
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-03 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 10:25 [PATCH] PCI/ERR: Clear fatal status of the reporting device Sizhe Liu
2026-02-27 16:31 ` Bjorn Helgaas
2026-02-27 18:01   ` Kuppuswamy Sathyanarayanan
2026-02-27 21:15   ` Lukas Wunner
2026-02-27 22:47     ` Kuppuswamy Sathyanarayanan
2026-02-28  2:06       ` Shuai Xue
2026-03-03 13:34         ` Sizhe Liu
2026-02-28 12:01     ` Sizhe Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox