]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI/AER: Clear stale errors on reporting agents upon probe
authorLukas Wunner <lukas@wunner.de>
Sun, 25 Jan 2026 09:25:51 +0000 (10:25 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 6 Feb 2026 22:21:42 +0000 (16:21 -0600)
commite242d09b58e869f86071b7889acace4cff215935
treefb740e42c353211aa4ab926082f36b2a8c9ddb39
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
PCI/AER: Clear stale errors on reporting agents upon probe

Correctable and Uncorrectable Error Status Registers on reporting agents
are cleared upon PCI device enumeration in pci_aer_init() to flush past
events.  They're cleared again when an error is handled by the AER driver.

If an agent reports a new error after pci_aer_init() and before the AER
driver has probed on the corresponding Root Port or Root Complex Event
Collector, that error is not handled by the AER driver:  It clears the
Root Error Status Register on probe, but neglects to re-clear the
Correctable and Uncorrectable Error Status Registers on reporting agents.

The error will eventually be reported when another error occurs.  Which
is irritating because to an end user it appears as if the earlier error
has just happened.

Amend the AER driver to clear stale errors on reporting agents upon probe.

Skip reporting agents which have not invoked pci_aer_init() yet to avoid
using an uninitialized pdev->aer_cap.  They're recognizable by the error
bits in the Device Control register still being clear.

Reporting agents may execute pci_aer_init() after the AER driver has
probed, particularly when devices are hotplugged or removed/rescanned via
sysfs.  For this reason, it continues to be necessary that pci_aer_init()
clears Correctable and Uncorrectable Error Status Registers.

Reported-by: Lucas Van <lucas.van@intel.com> # off-list
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Lucas Van <lucas.van@intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://patch.msgid.link/3011c2ed30c11f858e35e29939add754adea7478.1769332702.git.lukas@wunner.de
drivers/pci/pcie/aer.c