All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Error reporting for AER-incapable devices
@ 2026-11-18 10:40 Lukas Wunner
  2026-11-18 10:40 ` [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

Bjorn suggests "the PCI core should do pci_enable_pcie_error_reporting()
independent of whether the device has an AER Capability":

https://lore.kernel.org/r/20260826212619.GA1566339@bhelgaas/

This is done in patch [7/7].  The preceding patches contain prep work.

For context, PCIe r7.1 sec 6.2.1 defines two error reporting paradigms:
AER and baseline capability.  The latter relies (solely) on the error
enable/status bits in the Device Control and Device Status registers,
which exist on every PCIe device.  The kernel has supported the AER
paradigm for 20 years.  With the present series, it gains support for
the baseline capability paradigm.

Patches [1/7] and [2/7] reinstate DPC on AER-incapable Downstream Ports.
The kernel used to support this until 2018.  It is hereby fixed because
it eases introduction of baseline capability error reporting in the
subsequent patches.


Changes v1 -> v2:

* Patch [1/7]:
  * On AER-capable devices, infer severity from AER Extended Capability
    instead of Device Status register because the latter also logs masked
    errors (Sathya).
  * Fix storytelling in commit message because 4e5fad429bd1 changed
    behavior, not 708b20003624 (Sathya).

* Patch [3/7]:
  * New patch to clear error status bits more selectively (sashiko).

* Patch [4/7]:
  * Clear Fatal Errors as well on recovery failure (Sathya, sashiko).

* Patch [6/7]:
  * Amend kernel-doc of pci_aer_unmask_internal_errors() (Sathya).

* Patch [7/7]:
  * Convert AER severity to Device Status bit with new severity2devsta[]
    array, instead of renumbering AER severity (sashiko).
  * On entry of aer_get_device_error_info(), clear info->mask and
    info->first_error (Sathya, sashiko).
  * Emit "(no details available)" message for AER-incapable devices
    as well as for devices whose AER registers are deliberately not
    read on Fatal Errors (Sathya).
  * Amend commit message to inform that System Errors may be raised
    by AER-incapable devices if they have no AER- or DPC-capable
    port in their ancestry (Sathya).

Link to v1:

https://lore.kernel.org/r/cover.1790531238.git.lukas@wunner.de/


Lukas Wunner (6):
  PCI/DPC: Avoid access to non-existent AER capability
  PCI/DPC: Reinstate support for AER-incapable ports
  PCI/ERR: Clear error status bits more selectively
  PCI/AER: Drop AER native check from handles_cxl_errors()
  PCI/AER: Move AER capability check out of pcie_aer_is_native()
  PCI/AER: Enable baseline capability error reporting

Yury Murashka (1):
  PCI/ERR: Avoid stale error status bits on recovery failure

 .../ABI/testing/sysfs-bus-pci-devices-aer     | 26 +++++--
 Documentation/PCI/pcieaer-howto.rst           |  9 +--
 drivers/pci/pcie/aer.c                        | 76 +++++++++++++------
 drivers/pci/pcie/aer_cxl_rch.c                |  3 +-
 drivers/pci/pcie/dpc.c                        | 46 +++++++----
 drivers/pci/pcie/err.c                        | 14 +++-
 6 files changed, 120 insertions(+), 54 deletions(-)


base-commit: 6d69eeae8966bc3bea0facbd550f45ef9de41cc4
-- 
2.53.0


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

* [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  2026-11-18 11:04   ` sashiko-bot
  2026-11-18 10:40 ` [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports Lukas Wunner
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

Downstream Port Containment does not mandate presence of an Advanced Error
Reporting capability, so a Downstream Port may support DPC, but not AER
(PCIe r7.1 sec 6.2.11.2).

In February 2019, commit 9f08a5d896ce ("PCI/DPC: Fix print AER status in
DPC event handling") amended the DPC driver to access the AER capability
without checking for its presence.

This did not cause actual problems because in March 2018, commit
4e5fad429bd1 ("PCI/DPC: Do not enable DPC if AER control is not allowed by
the BIOS") had seemingly inadvertently prevented instantiation of a DPC
port service on AER-incapable ports.

However in October 2019, commit 35a0b2378c19 ("PCI/DPC: Add
"pcie_ports=dpc-native" to allow DPC without AER control") made it
possible to override this:  The DPC driver may access a non-existent AER
capability if "pcie_ports=dpc-native" is passed on the command line.

Fix it by making the DPC driver cope with AER-unsupporting Downstream
Ports.

There are two places where the AER capability is accessed:

- dpc_get_aer_uncorrect_severity() uses it to discern whether a Fatal or
  Non-Fatal Error triggered DPC.  Access the Device Status Register
  instead, in accordance with PCIe r7.1 sec 6.2.5.

- dpc_is_surprise_removal() uses it to detect whether a Surprise Down
  Error triggered DPC.  Return false on AER-unsupporting devices.  The
  function works around an AMD-specific quirk and it seems reasonable to
  assume that all affected products are AER-supporting.  In any case the
  detection is not possible without AER capability.

Insert a temporary check for an AER capability after the call to
aer_get_device_error_info() because the function currently returns false
for AER-unsupporting devices.  The check will become obsolete and will be
removed with the imminent baseline capability error reporting.

Fixes: 35a0b2378c19 ("PCI/DPC: Add "pcie_ports=dpc-native" to allow DPC without AER control")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org # v5.5+
---
Changes v1 -> v2:
  * On AER-capable devices, infer severity from AER Extended Capability
    instead of Device Status register because the latter also logs masked
    errors (Sathya).
  * Fix storytelling in commit message because 4e5fad429bd1 changed
    behavior, not 708b20003624 (Sathya).
 
 drivers/pci/pcie/dpc.c | 45 ++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 13 deletions(-)

diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index 2b779bd1d861..d02cbbbe3143 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -238,19 +238,35 @@ static int dpc_get_aer_uncorrect_severity(struct pci_dev *dev,
 {
 	int pos = dev->aer_cap;
 	u32 status, mask, sev;
+	u16 devsta;
 
-	pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status);
-	pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, &mask);
-	status &= ~mask;
-	if (!status)
-		return 0;
-
-	pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &sev);
-	status &= sev;
-	if (status)
-		info->severity = AER_FATAL;
-	else
-		info->severity = AER_NONFATAL;
+	/*
+	 * Infer severity from AER Extended Capability if present, else from
+	 * Device Status register.  The latter cannot be used on AER-capable
+	 * ports because it also logs masked errors (PCIe r7.1 sec 7.5.3.5).
+	 */
+	if (pos) {
+		pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status);
+		pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, &mask);
+		status &= ~mask;
+		if (!status)
+			return 0;
+
+		pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &sev);
+		status &= sev;
+		if (status)
+			info->severity = AER_FATAL;
+		else
+			info->severity = AER_NONFATAL;
+	} else {
+		pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &devsta);
+		if (devsta & PCI_EXP_DEVSTA_FED)
+			info->severity = AER_FATAL;
+		else if (devsta & PCI_EXP_DEVSTA_NFED)
+			info->severity = AER_NONFATAL;
+		else
+			return 0;
+	}
 
 	info->level = KERN_ERR;
 
@@ -275,7 +291,7 @@ void dpc_process_error(struct pci_dev *pdev)
 		pci_warn(pdev, "containment event, status:%#06x: unmasked uncorrectable error detected\n",
 			 status);
 		if (dpc_get_aer_uncorrect_severity(pdev, &info) &&
-		    aer_get_device_error_info(&info, 0)) {
+		    (aer_get_device_error_info(&info, 0) || !pdev->aer_cap)) {
 			aer_print_error(&info, 0);
 			pci_aer_clear_nonfatal_status(pdev);
 			pci_aer_clear_fatal_status(pdev);
@@ -353,6 +369,9 @@ static bool dpc_is_surprise_removal(struct pci_dev *pdev)
 	if (!pdev->is_hotplug_bridge)
 		return false;
 
+	if (!pdev->aer_cap)
+		return false;
+
 	if (pci_read_config_word(pdev, pdev->aer_cap + PCI_ERR_UNCOR_STATUS,
 				 &status))
 		return false;
-- 
2.53.0


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

* [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
  2026-11-18 10:40 ` [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  2026-11-18 11:03   ` sashiko-bot
  2026-11-18 10:40 ` [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively Lukas Wunner
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

Downstream Port Containment does not mandate presence of an Advanced Error
Reporting capability, so a Downstream Port may support DPC, but not AER
(PCIe r7.1 sec 6.2.11.2).

Commit 708b20003624 ("PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER
ownership") seemingly inadvertently constrained DPC to AER-supporting
Downstream Ports by inserting a call to pcie_aer_is_native() in
dpc_probe(), which implicitly checks for presence of an AER capability.

Drop the call.  It is superfluous because it duplicates the conditions
applied by the PCIe port service driver when it decides whether to
instantiate a DPC port service (see get_port_device_capability()).
If the conditions are not met, no port service is instantiated and
dpc_probe() isn't executed.

The only difference between the conditions in dpc_probe() and the ones in
get_port_device_capability() is the check for the AER capability, so by
removing the checks from dpc_probe(), DPC is supported on AER-incapable
Downstream Ports again.

Fixes: 708b20003624 ("PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: stable@vger.kernel.org # v5.8+
---
 drivers/pci/pcie/dpc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index d02cbbbe3143..a0880e3cd68c 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -496,9 +496,6 @@ static int dpc_probe(struct pcie_device *dev)
 	int status;
 	u16 cap;
 
-	if (!pcie_aer_is_native(pdev) && !pcie_ports_dpc_native)
-		return -ENOTSUPP;
-
 	status = devm_request_threaded_irq(device, dev->irq, dpc_irq,
 					   dpc_handler, IRQF_SHARED,
 					   "pcie-dpc", pdev);
-- 
2.53.0


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

* [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
  2026-11-18 10:40 ` [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
  2026-11-18 10:40 ` [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  2026-11-18 11:09   ` sashiko-bot
  2026-11-18 10:40 ` [PATCH v2 4/7] PCI/ERR: Avoid stale error status bits on recovery failure Lukas Wunner
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

After recovery from a PCIe error, all of the error status bits in the
Device Status register are cleared indiscriminately, regardless of the
error's severity.

So when a Correctable Error occurs simultaneously to an Uncorrectable
Error, after the former is handled, it is cleared alongside the latter.
As a result, the Uncorrectable Error isn't handled at all.

Conversely, an Uncorrectable Error occurring shortly before a Correctable
Error may cause the latter to be cleared and thus ignored.

Avoid by clearing only the error bits corresponding to the error severity
being handled.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
Changes v1 -> v2:
  * New patch to clear error status bits more selectively (sashiko).
 
 drivers/pci/pcie/aer.c | 20 +++++++++++++++++++-
 drivers/pci/pcie/err.c |  7 ++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 6f2460231422..51cf2ff8c85a 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -141,6 +141,12 @@ struct aer_info {
 					PCI_ERR_ROOT_MULTI_COR_RCV |	\
 					PCI_ERR_ROOT_MULTI_UNCOR_RCV)
 
+static const u8 severity2devsta[] = {
+	[AER_NONFATAL]    = PCI_EXP_DEVSTA_NFED,
+	[AER_FATAL]       = PCI_EXP_DEVSTA_FED,
+	[AER_CORRECTABLE] = PCI_EXP_DEVSTA_CED,
+};
+
 static bool pcie_aer_disable;
 static pci_ers_result_t aer_root_reset(struct pci_dev *dev);
 
@@ -1314,6 +1320,17 @@ bool is_aer_internal_error(struct aer_err_info *info)
 }
 #endif
 
+static void pcie_clear_device_status_sev(struct pci_dev *dev, u8 severity,
+					 u32 uncor_status)
+{
+	u16 devsta = severity2devsta[severity];
+
+	if (uncor_status & PCI_ERR_UNC_UNSUP)
+		devsta |= PCI_EXP_DEVSTA_URD;
+
+	pcie_capability_write_word(dev, PCI_EXP_DEVSTA, devsta);
+}
+
 /**
  * pci_aer_handle_error - handle logging error into an event log
  * @dev: pointer to pci_dev data structure of error source device
@@ -1344,7 +1361,8 @@ static void pci_aer_handle_error(struct pci_dev *dev, struct aer_err_info *info)
 			if (pdrv && pdrv->err_handler &&
 			    pdrv->err_handler->cor_error_detected)
 				pdrv->err_handler->cor_error_detected(dev);
-			pcie_clear_device_status(dev);
+			pcie_clear_device_status_sev(dev, AER_CORRECTABLE,
+						     info->anfe_status);
 		}
 	} else if (info->severity == AER_NONFATAL)
 		pcie_do_recovery(dev, pci_channel_io_normal, aer_root_reset);
diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
index 1a7fc71c79d8..24a8a8263c2e 100644
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -21,6 +21,10 @@
 #include "portdrv.h"
 #include "../pci.h"
 
+#define PCI_EXP_DEVSTA_UNC_MASK	(PCI_EXP_DEVSTA_NFED | \
+				 PCI_EXP_DEVSTA_FED | \
+				 PCI_EXP_DEVSTA_URD)
+
 static pci_ers_result_t merge_result(enum pci_ers_result orig,
 				  enum pci_ers_result new)
 {
@@ -274,7 +278,8 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
 	 * signaling device may not even be visible to the OS.
 	 */
 	if (host->native_aer) {
-		pcie_clear_device_status(dev);
+		pcie_capability_write_word(dev, PCI_EXP_DEVSTA,
+					   PCI_EXP_DEVSTA_UNC_MASK);
 		pci_aer_clear_nonfatal_status(dev);
 	}
 
-- 
2.53.0



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

* [PATCH v2 4/7] PCI/ERR: Avoid stale error status bits on recovery failure
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
                   ` (2 preceding siblings ...)
  2026-11-18 10:40 ` [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  2026-11-18 10:40 ` [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors() Lukas Wunner
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

From: Yury Murashka <yurypm@arista.com>

pcie_do_recovery() only clears the error status bits of an error-reporting
device if recovery succeeds, but not if it fails.  (E.g. because reset
failed, drivers are missing pci_error_handlers or those handlers failed.)

One undesirable consequence is that the AER driver may subsequently
identify a wrong device when searching for error-reporting devices in
is_error_source(), due to stale bits on an unaffected device.

Avoid by clearing error status bits on recovery failure.

If recovery succeeds, Fatal Errors are generally cleared by a call to
pci_restore_state() from drivers' ->slot_reset() callbacks.  If recovery
fails, those callbacks may not have been invoked or they may not be
implemented.  Hence clear Fatal Errors as well on recovery failure.

Link: https://lore.kernel.org/r/CAPzpGcRCTCZtaX1EVaJNZ103THZKsoszZduY7=gwfYdcrMo-SQ@mail.gmail.com/
Signed-off-by: Yury Murashka <yurypm@arista.com>
[lukas: drop cmdline param, rewrite commit msg, clear fatal errors]
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
Changes v1 -> v2:
  * Clear Fatal Errors as well on recovery failure (Sathya, sashiko).
 
 drivers/pci/pcie/err.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
index 24a8a8263c2e..a450146fb285 100644
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -289,6 +289,13 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,
 	return status;
 
 failed:
+	if (host->native_aer) {
+		pcie_capability_write_word(dev, PCI_EXP_DEVSTA,
+					   PCI_EXP_DEVSTA_UNC_MASK);
+		pci_aer_clear_nonfatal_status(dev);
+		pci_aer_clear_fatal_status(dev);
+	}
+
 	pci_walk_bridge(bridge, pci_pm_runtime_put, NULL);
 
 	pci_walk_bridge(bridge, report_perm_failure_detected, NULL);
-- 
2.53.0


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

* [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors()
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
                   ` (3 preceding siblings ...)
  2026-11-18 10:40 ` [PATCH v2 4/7] PCI/ERR: Avoid stale error status bits on recovery failure Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  2026-11-18 11:02   ` sashiko-bot
  2026-11-18 10:40 ` [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native() Lukas Wunner
  2026-11-18 10:40 ` [PATCH v2 7/7] PCI/AER: Enable baseline capability error reporting Lukas Wunner
  6 siblings, 1 reply; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

Drop a superfluous call to pcie_aer_is_native() from handles_cxl_errors().

The call is superfluous because the function is only called from:

  aer_probe()
    cxl_rch_enable_rcec()
      handles_cxl_errors()

...and aer_probe() is only invoked if an AER port service was instantiated
in get_port_device_capability(), which is conditional on:

  (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT ||
   pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC) &&
  pci_aer_available() &&
  dev->aer_cap && (pcie_ports_native || host->native_aer))

...and the last line of those conditions is equivalent to
pcie_aer_is_native().

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/pci/pcie/aer_cxl_rch.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/aer_cxl_rch.c b/drivers/pci/pcie/aer_cxl_rch.c
index b480dad8bbf4..dfcedb7d277d 100644
--- a/drivers/pci/pcie/aer_cxl_rch.c
+++ b/drivers/pci/pcie/aer_cxl_rch.c
@@ -87,8 +87,7 @@ static bool handles_cxl_errors(struct pci_dev *rcec)
 {
 	bool handles_cxl = false;
 
-	if (pci_pcie_type(rcec) == PCI_EXP_TYPE_RC_EC &&
-	    pcie_aer_is_native(rcec))
+	if (pci_pcie_type(rcec) == PCI_EXP_TYPE_RC_EC)
 		pcie_walk_rcec(rcec, handles_cxl_error_iter, &handles_cxl);
 
 	return handles_cxl;
-- 
2.53.0


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

* [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native()
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
                   ` (4 preceding siblings ...)
  2026-11-18 10:40 ` [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors() Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  2026-11-18 11:13   ` sashiko-bot
  2026-11-18 10:40 ` [PATCH v2 7/7] PCI/AER: Enable baseline capability error reporting Lukas Wunner
  6 siblings, 1 reply; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

When firmware grants control of Advanced Error Reporting to the operating
system, that not only encompasses the AER capability, but also error
enable/status bits in the Device Control and Device Status registers
(PCI Firmware r3.3 table 4-6 bit 3).

PCIe devices without AER capability still support baseline capability
error reporting through these enable/status bits (PCIe r7.1 sec 6.2.1),
but the bits must not be modified unless AER control was granted.

pcie_aer_is_native() is unsuitable to check for control of AER-incapable
devices because it implicitly checks for presence of an AER capability.

Move that check to its callers (where needed) to allow using the function
for the imminent baseline capability error reporting.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
Changes v1 -> v2:
  * Amend kernel-doc of pci_aer_unmask_internal_errors() (Sathya).
 
 drivers/pci/pcie/aer.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 51cf2ff8c85a..9bb8e2127849 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -263,9 +263,6 @@ int pcie_aer_is_native(struct pci_dev *dev)
 {
 	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
 
-	if (!dev->aer_cap)
-		return 0;
-
 	return host->native_aer;
 }
 EXPORT_SYMBOL_NS_GPL(pcie_aer_is_native, "CXL");
@@ -286,7 +283,7 @@ int pci_aer_clear_nonfatal_status(struct pci_dev *dev)
 	int aer = dev->aer_cap;
 	u32 status, sev;
 
-	if (!pcie_aer_is_native(dev))
+	if (!aer || !pcie_aer_is_native(dev))
 		return -EIO;
 
 	/* Clear status bits for ERR_NONFATAL errors only */
@@ -305,7 +302,7 @@ void pci_aer_clear_fatal_status(struct pci_dev *dev)
 	int aer = dev->aer_cap;
 	u32 status, sev;
 
-	if (!pcie_aer_is_native(dev))
+	if (!aer || !pcie_aer_is_native(dev))
 		return;
 
 	/* Clear status bits for ERR_FATAL errors only */
@@ -1288,7 +1285,7 @@ static bool find_source_device(struct pci_dev *parent,
  * Mask registers.
  *
  * Note: AER must be enabled and supported by the device which must be
- * checked in advance, e.g. with pcie_aer_is_native().
+ * checked in advance, e.g. with dev->aer_cap && pcie_aer_is_native(dev).
  */
 void pci_aer_unmask_internal_errors(struct pci_dev *dev)
 {
-- 
2.53.0


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

* [PATCH v2 7/7] PCI/AER: Enable baseline capability error reporting
  2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
                   ` (5 preceding siblings ...)
  2026-11-18 10:40 ` [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native() Lukas Wunner
@ 2026-11-18 10:40 ` Lukas Wunner
  6 siblings, 0 replies; 13+ messages in thread
From: Lukas Wunner @ 2026-11-18 10:40 UTC (permalink / raw)
  To: Bjorn Helgaas, Raag Jadav, linux-pci
  Cc: Sourabh Jain, Oliver OHalloran, linuxppc-dev, Aravind Iddamsetty,
	Srinivasa Adatrao, Sathyanarayanan Kuppuswamy, Terry Bowman,
	Keith Busch, Maciej Grochowski, Yazen Ghannam, Darshit Shah,
	Jason Perlow, Riana Tauro, Yury Murashka, Matthew W Carlis

PCIe r7.1 sec 6.2.1 defines two error reporting paradigms:  Baseline
capability and Advanced Error Reporting Extended Capability (AER).

So far the kernel only supports the AER paradigm.  Enable the baseline
capability paradigm to complete the kernel's support for error reporting.

Baseline capability (solely) relies on the error enable/status bits in the
Device Control and Device Status registers, which exist on every PCIe
device.  One difference between baseline capability and AER is that the
severity of Uncorrectable Errors cannot be controlled.  Another difference
is that Advisory Non-Fatal Errors are not reported at all (PCIe r7.1 sec
6.2.5).

But the main difference to AER is that no detailed error information is
available:  It is only known that an error occurred and which severity it
had, but not its type or the Prefix / Header of the TLP that caused it.
An exception are Unsupported Request Errors which are signaled with a
dedicated bit in the Device Status register.  Report these as if the
Unsupported Request Error Status bit in the Uncorrectable Error Status
register was set, for consistency with the AER paradigm.

Error recovery works the same for baseline capability as it already does
for AER:  Drivers are informed about errors through the pci_error_handlers
callbacks.  Recovery from Fatal Errors (and from Non-Fatal Errors, if
chosen by drivers) is attempted through a Secondary Bus Reset.

Similarly to commit f26e58bf6f54 ("PCI/AER: Enable error reporting when
AER is native"), which universally enabled error reporting on AER-capable
devices, the present commit is invasive because it universally enables
error reporting on AER-incapable devices.  Previously those errors were
neither reported nor recovered.  It may be necessary to amend more drivers
with pci_error_handlers callbacks to recover from newly reported errors.

Baseline capability is only enabled if firmware grants AER control to the
operating system.  Otherwise firmware owns the error enable/status bits in
the Device Control and Device Status registers (PCI Firmware r3.3 table
4-6 bit 3).

Baseline capability support is initially only implemented for native error
handling, not Firmware First error handling:  ghes_handle_aer() would have
to be amended to pass the Device Control and Device Status registers to
aer_recover_queue(), and to only pass an AER capability structure if it is
present in the CPER record.  It's not clear whether any firmware actually
generates such CPER records and whether implementing support for it is
worthwhile, so postpone that for now.

Devices without AER-capable Root Ports or DPC-capable Downstream Ports in
their ancestry may cause System Errors if the corresponding bits in the
Root Control register have been set by platform firmware or the user.
Previously this could only occur with AER-capable devices.  The present
commit extends it to AER-incapable devices.

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20260826212619.GA1566339@bhelgaas/
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
Changes v1 -> v2:
  * Convert AER severity to Device Status bit with new severity2devsta[]
    array, instead of renumbering AER severity (sashiko).
  * On entry of aer_get_device_error_info(), clear info->mask and
    info->first_error (Sathya, sashiko).
  * Emit "(no details available)" message for AER-incapable devices
    as well as for devices whose AER registers are deliberately not
    read on Fatal Errors (Sathya).
  * Amend commit message to inform that System Errors may be raised
    by AER-incapable devices if they have no AER- or DPC-capable
    port in their ancestry (Sathya).
 
 .../ABI/testing/sysfs-bus-pci-devices-aer     | 26 ++++++----
 Documentation/PCI/pcieaer-howto.rst           |  9 ++--
 drivers/pci/pcie/aer.c                        | 47 ++++++++++++-------
 drivers/pci/pcie/dpc.c                        |  2 +-
 4 files changed, 54 insertions(+), 30 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-pci-devices-aer b/Documentation/ABI/testing/sysfs-bus-pci-devices-aer
index 5ed284523956..9e772e1ed9b3 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci-devices-aer
+++ b/Documentation/ABI/testing/sysfs-bus-pci-devices-aer
@@ -1,9 +1,9 @@
 PCIe Device AER statistics
 --------------------------
 
-These attributes show up under all the devices that are AER capable. These
+These attributes show up under all PCIe devices (AER capable or not). These
 statistical counters indicate the errors "as seen/reported by the device".
-Note that this may mean that if an endpoint is causing problems, the AER
+Note that this may mean that if an endpoint is causing problems, the error
 counters may increment at its link partner (e.g. root port) because the
 errors may be "seen" / reported by the link partner and not the
 problematic endpoint itself (which may report all counters as 0 as it never
@@ -17,7 +17,10 @@ Description:	List of correctable errors seen and reported by this
 		PCI device using ERR_COR. Note that since multiple errors may
 		be reported using a single ERR_COR message, thus
 		TOTAL_ERR_COR at the end of the file may not match the actual
-		total of all the errors in the file. Sample output::
+		total of all the errors in the file.
+		For PCIe devices without AER Extended Capability, only the
+		total counter is meaningful while all other counters remain 0.
+		Sample output::
 
 		    localhost /sys/devices/pci0000:00/0000:00:1c.0 # cat aer_dev_correctable
 		    Receiver Error 2
@@ -38,7 +41,10 @@ Description:	List of uncorrectable fatal errors seen and reported by this
 		PCI device using ERR_FATAL. Note that since multiple errors may
 		be reported using a single ERR_FATAL message, thus
 		TOTAL_ERR_FATAL at the end of the file may not match the actual
-		total of all the errors in the file. Sample output::
+		total of all the errors in the file.
+		For PCIe devices without AER Extended Capability, only the
+		total counter is meaningful while all other counters remain 0.
+		Sample output::
 
 		    localhost /sys/devices/pci0000:00/0000:00:1c.0 # cat aer_dev_fatal
 		    Undefined 0
@@ -68,7 +74,11 @@ Description:	List of uncorrectable nonfatal errors seen and reported by this
 		PCI device using ERR_NONFATAL. Note that since multiple errors
 		may be reported using a single ERR_FATAL message, thus
 		TOTAL_ERR_NONFATAL at the end of the file may not match the
-		actual total of all the errors in the file. Sample output::
+		actual total of all the errors in the file.
+		For PCIe devices without AER Extended Capability, only the
+		total counter and the Unsupported Request counter is meaningful
+		while all other counters remain 0.
+		Sample output::
 
 		    localhost /sys/devices/pci0000:00/0000:00:1c.0 # cat aer_dev_nonfatal
 		    Undefined 0
@@ -121,7 +131,7 @@ Description:	Total number of ERR_NONFATAL messages reported to rootport.
 PCIe AER ratelimits
 -------------------
 
-These attributes show up under all the devices that are AER capable.
+These attributes show up under all PCIe devices (AER capable or not).
 They represent configurable ratelimits of logs per error type.
 
 See Documentation/PCI/pcieaer-howto.rst for more info on ratelimits.
@@ -130,7 +140,7 @@ What:		/sys/bus/pci/devices/<dev>/aer/correctable_ratelimit_interval_ms
 Date:		May 2025
 KernelVersion:	6.16.0
 Contact:	linux-pci@vger.kernel.org
-Description:	Writing 0 disables AER correctable error log ratelimiting.
+Description:	Writing 0 disables Correctable Error log ratelimiting.
 		Writing a positive value sets the ratelimit interval in ms.
 		Default is DEFAULT_RATELIMIT_INTERVAL (5000 ms).
 
@@ -147,7 +157,7 @@ What:		/sys/bus/pci/devices/<dev>/aer/nonfatal_ratelimit_interval_ms
 Date:		May 2025
 KernelVersion:	6.16.0
 Contact:	linux-pci@vger.kernel.org
-Description:	Writing 0 disables AER non-fatal uncorrectable error log
+Description:	Writing 0 disables Non-Fatal Uncorrectable Error log
 		ratelimiting. Writing a positive value sets the ratelimit
 		interval in ms. Default is DEFAULT_RATELIMIT_INTERVAL
 		(5000 ms).
diff --git a/Documentation/PCI/pcieaer-howto.rst b/Documentation/PCI/pcieaer-howto.rst
index 90fdfddd3ae5..e969e563b61d 100644
--- a/Documentation/PCI/pcieaer-howto.rst
+++ b/Documentation/PCI/pcieaer-howto.rst
@@ -34,9 +34,8 @@ set of error reporting requirements. Advanced Error Reporting
 capability is implemented with a PCIe Advanced Error Reporting
 extended capability structure providing more robust error reporting.
 
-The PCIe AER driver provides the infrastructure to support PCIe Advanced
-Error Reporting capability. The PCIe AER driver provides three basic
-functions:
+The PCIe AER driver provides the infrastructure to support both paradigms.
+It provides three basic functions:
 
   - Gathers the comprehensive error information if errors occurred.
   - Reports error to the users.
@@ -69,7 +68,7 @@ Specification for details regarding _OSC usage.
 AER error output
 ----------------
 
-When a PCIe AER error is captured, an error message will be output to
+When a PCIe error is captured, an error message will be output to
 console. If it's a correctable error, it is output as a warning message.
 Otherwise, it is printed as an error. So users could choose different
 log level to filter out correctable error messages.
@@ -113,7 +112,7 @@ See Documentation/ABI/testing/sysfs-bus-pci-devices-aer.
 AER Statistics / Counters
 -------------------------
 
-When PCIe AER errors are captured, the counters / statistics are also exposed
+When PCIe errors are captured, the counters / statistics are also exposed
 in the form of sysfs attributes which are documented at
 Documentation/ABI/testing/sysfs-bus-pci-devices-aer.
 
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 9bb8e2127849..3c28afca5d03 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -403,21 +403,22 @@ void pci_aer_init(struct pci_dev *dev)
 {
 	int n;
 
-	dev->aer_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
-	if (!dev->aer_cap)
+	if (!pci_is_pcie(dev))
 		return;
 
 	dev->aer_info = kzalloc_obj(*dev->aer_info);
-	if (!dev->aer_info) {
-		dev->aer_cap = 0;
+	if (!dev->aer_info)
 		return;
-	}
 
 	ratelimit_state_init(&dev->aer_info->correctable_ratelimit,
 			     DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);
 	ratelimit_state_init(&dev->aer_info->nonfatal_ratelimit,
 			     DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST);
 
+	dev->aer_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
+	if (!dev->aer_cap)
+		goto enable;
+
 	/*
 	 * We save/restore PCI_ERR_UNCOR_MASK, PCI_ERR_UNCOR_SEVER,
 	 * PCI_ERR_COR_MASK, and PCI_ERR_CAP.  Root and Root Complex Event
@@ -438,6 +439,9 @@ void pci_aer_init(struct pci_dev *dev)
 					       PCI_ERR_COR_ADV_NFAT, 0);
 
 	pci_aer_clear_status(dev);
+enable:
+	if (pcie_aer_is_native(dev))
+		pcie_clear_device_status(dev);
 
 	if (pci_aer_available())
 		pci_enable_pcie_error_reporting(dev);
@@ -988,14 +992,12 @@ void aer_print_error(struct aer_err_info *info, int i)
 	if (!info->ratelimit_print[i])
 		goto anfe;
 
-	if (!info->status) {
-		pci_err(dev, "%s Bus Error: severity=%s (Inaccessible)\n",
-			bus_type, aer_error_severity_string[info->severity]);
-		return;
-	}
+	aer_printk(level, dev, "%s Bus Error: severity=%s%s\n",
+		   bus_type, aer_error_severity_string[info->severity],
+		   info->status ? "" : " (no details available)");
 
-	aer_printk(level, dev, "%s Bus Error: severity=%s\n",
-		   bus_type, aer_error_severity_string[info->severity]);
+	if (!info->status)
+		return;
 
 	aer_printk(level, dev, "  device [%04x:%04x] error status/mask=%08x/%08x\n",
 		   dev->vendor, dev->device, info->status, info->mask);
@@ -1204,8 +1206,11 @@ static bool is_error_source(struct pci_dev *dev, struct aer_err_info *e_info)
 	if (!(reg16 & PCI_EXP_AER_FLAGS))
 		return false;
 
-	if (!aer)
-		return false;
+	if (!aer) {
+		pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &reg16);
+		return reg16 & severity2devsta[e_info->severity] &&
+		       !PCI_POSSIBLE_ERROR(reg16);
+	}
 
 	/* Check if error is recorded */
 	if (e_info->severity == AER_CORRECTABLE) {
@@ -1521,6 +1526,7 @@ int aer_get_device_error_info(struct aer_err_info *info, int i)
 {
 	struct pci_dev *dev;
 	int type, aer;
+	u16 devsta;
 
 	if (i >= AER_MAX_MULTI_ERR_DEVICES)
 		return 0;
@@ -1531,13 +1537,22 @@ int aer_get_device_error_info(struct aer_err_info *info, int i)
 
 	/* Must reset in this function */
 	info->status = 0;
+	info->mask = 0;
 	info->anfe_status = 0;
+	info->first_error = 0;
 	info->tlp_header_valid = 0;
 	info->is_cxl = pcie_is_cxl(dev);
 
 	/* The device might not support AER */
-	if (!aer)
-		return 0;
+	if (!aer) {
+		if (info->severity != AER_CORRECTABLE) {
+			pcie_capability_read_word(dev, PCI_EXP_DEVSTA, &devsta);
+			if (devsta & PCI_EXP_DEVSTA_URD &&
+			    !PCI_POSSIBLE_ERROR(devsta))
+				info->status = PCI_ERR_UNC_UNSUP;
+		}
+		return 1;
+	}
 
 	if (info->severity == AER_CORRECTABLE) {
 		pci_read_config_dword(dev, aer + PCI_ERR_COR_STATUS,
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index a0880e3cd68c..bf5295fe1f4f 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -291,7 +291,7 @@ void dpc_process_error(struct pci_dev *pdev)
 		pci_warn(pdev, "containment event, status:%#06x: unmasked uncorrectable error detected\n",
 			 status);
 		if (dpc_get_aer_uncorrect_severity(pdev, &info) &&
-		    (aer_get_device_error_info(&info, 0) || !pdev->aer_cap)) {
+		    aer_get_device_error_info(&info, 0)) {
 			aer_print_error(&info, 0);
 			pci_aer_clear_nonfatal_status(pdev);
 			pci_aer_clear_fatal_status(pdev);
-- 
2.53.0



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

* Re: [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors()
  2026-11-18 10:40 ` [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors() Lukas Wunner
@ 2026-11-18 11:02   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-18 11:02 UTC (permalink / raw)
  To: Lukas Wunner, linux-pci

> Drop a superfluous call to pcie_aer_is_native() from handles_cxl_errors().
> 
> The call is superfluous because the function is only called from:
> 
>   aer_probe()
>     cxl_rch_enable_rcec()
>       handles_cxl_errors()
> 
> ...and aer_probe() is only invoked if an AER port service was instantiated
> in get_port_device_capability(), which is conditional on:
> 
>   (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT ||
>    pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC) &&
>   pci_aer_available() &&
>   dev->aer_cap && (pcie_ports_native || host->native_aer))
> 
> ...and the last line of those conditions is equivalent to
> pcie_aer_is_native().
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794997749.git.lukas@wunner.de?part=5


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

* Re: [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports
  2026-11-18 10:40 ` [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports Lukas Wunner
@ 2026-11-18 11:03   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-18 11:03 UTC (permalink / raw)
  To: Lukas Wunner, linux-pci

> Downstream Port Containment does not mandate presence of an Advanced Error
> Reporting capability, so a Downstream Port may support DPC, but not AER
> (PCIe r7.1 sec 6.2.11.2).
> 
> Commit 708b20003624 ("PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER
> ownership") seemingly inadvertently constrained DPC to AER-supporting
> Downstream Ports by inserting a call to pcie_aer_is_native() in
> dpc_probe(), which implicitly checks for presence of an AER capability.
> 
> Drop the call.  It is superfluous because it duplicates the conditions
> applied by the PCIe port service driver when it decides whether to
> instantiate a DPC port service (see get_port_device_capability()).
> If the conditions are not met, no port service is instantiated and
> dpc_probe() isn't executed.
> 
> The only difference between the conditions in dpc_probe() and the ones in
> get_port_device_capability() is the check for the AER capability, so by
> removing the checks from dpc_probe(), DPC is supported on AER-incapable
> Downstream Ports again.
> 
> Fixes: 708b20003624 ("PCI/AER: Remove HEST/FIRMWARE_FIRST parsing for AER ownership")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794997749.git.lukas@wunner.de?part=2


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

* Re: [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability
  2026-11-18 10:40 ` [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
@ 2026-11-18 11:04   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-18 11:04 UTC (permalink / raw)
  To: Lukas Wunner, linux-pci

> Downstream Port Containment does not mandate presence of an Advanced Error
> Reporting capability, so a Downstream Port may support DPC, but not AER
> (PCIe r7.1 sec 6.2.11.2).
> 
> In February 2019, commit 9f08a5d896ce ("PCI/DPC: Fix print AER status in
> DPC event handling") amended the DPC driver to access the AER capability
> without checking for its presence.
> 
> This did not cause actual problems because in March 2018, commit
> 4e5fad429bd1 ("PCI/DPC: Do not enable DPC if AER control is not allowed by
> the BIOS") had seemingly inadvertently prevented instantiation of a DPC
> port service on AER-incapable ports.
> 
> However in October 2019, commit 35a0b2378c19 ("PCI/DPC: Add
> "pcie_ports=dpc-native" to allow DPC without AER control") made it
> [ ... ]
> for AER-unsupporting devices.  The check will become obsolete and will be
> removed with the imminent baseline capability error reporting.
> 
> Fixes: 35a0b2378c19 ("PCI/DPC: Add "pcie_ports=dpc-native" to allow DPC without AER control")
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794997749.git.lukas@wunner.de?part=1


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

* Re: [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively
  2026-11-18 10:40 ` [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively Lukas Wunner
@ 2026-11-18 11:09   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-18 11:09 UTC (permalink / raw)
  To: Lukas Wunner, linux-pci

> After recovery from a PCIe error, all of the error status bits in the
> Device Status register are cleared indiscriminately, regardless of the
> error's severity.
> 
> So when a Correctable Error occurs simultaneously to an Uncorrectable
> Error, after the former is handled, it is cleared alongside the latter.
> As a result, the Uncorrectable Error isn't handled at all.
> 
> Conversely, an Uncorrectable Error occurring shortly before a Correctable
> Error may cause the latter to be cleared and thus ignored.
> 
> Avoid by clearing only the error bits corresponding to the error severity
> being handled.
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794997749.git.lukas@wunner.de?part=3


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

* Re: [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native()
  2026-11-18 10:40 ` [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native() Lukas Wunner
@ 2026-11-18 11:13   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-18 11:13 UTC (permalink / raw)
  To: Lukas Wunner, linux-pci

> When firmware grants control of Advanced Error Reporting to the operating
> system, that not only encompasses the AER capability, but also error
> enable/status bits in the Device Control and Device Status registers
> (PCI Firmware r3.3 table 4-6 bit 3).
> 
> PCIe devices without AER capability still support baseline capability
> error reporting through these enable/status bits (PCIe r7.1 sec 6.2.1),
> but the bits must not be modified unless AER control was granted.
> 
> pcie_aer_is_native() is unsuitable to check for control of AER-incapable
> devices because it implicitly checks for presence of an AER capability.
> 
> Move that check to its callers (where needed) to allow using the function
> for the imminent baseline capability error reporting.
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1794997749.git.lukas@wunner.de?part=6


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

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 10:40 [PATCH v2 0/7] Error reporting for AER-incapable devices Lukas Wunner
2026-11-18 10:40 ` [PATCH v2 1/7] PCI/DPC: Avoid access to non-existent AER capability Lukas Wunner
2026-11-18 11:04   ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 2/7] PCI/DPC: Reinstate support for AER-incapable ports Lukas Wunner
2026-11-18 11:03   ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 3/7] PCI/ERR: Clear error status bits more selectively Lukas Wunner
2026-11-18 11:09   ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 4/7] PCI/ERR: Avoid stale error status bits on recovery failure Lukas Wunner
2026-11-18 10:40 ` [PATCH v2 5/7] PCI/AER: Drop AER native check from handles_cxl_errors() Lukas Wunner
2026-11-18 11:02   ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 6/7] PCI/AER: Move AER capability check out of pcie_aer_is_native() Lukas Wunner
2026-11-18 11:13   ` sashiko-bot
2026-11-18 10:40 ` [PATCH v2 7/7] PCI/AER: Enable baseline capability error reporting Lukas Wunner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.