[PATCH v13 1/5] PCI/DPC: Ignore devices with no AER Capability
From: Kuppuswamy Sathyanarayanan
Date: Sat Sep 19 2026 - 12:28:36 EST
From: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Downstream Ports may support DPC regardless of whether they support AER
(see PCIe r7.0, sec 6.2.11.2). Previously, if the user booted with
"pcie_ports=dpc-native", it was possible for dpc_probe() to succeed even if
the device had no AER Capability, but dpc_get_aer_uncorrect_severity()
depends on the AER Capability.
dpc_probe() previously failed if:
!pcie_aer_is_native(pdev) && !pcie_ports_dpc_native
!(pcie_aer_is_native() || pcie_ports_dpc_native) # by De Morgan's law
so it succeeded if:
pcie_aer_is_native() || pcie_ports_dpc_native
Fail dpc_probe() if the device has no AER Capability.
Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: Olof Johansson <olof@xxxxxxxxx>
---
Changes since v12
* Rebased to v7.3-rc3. No other changes.
v12 posting
https://lore.kernel.org/all/20201126011816.711106-1-helgaas@xxxxxxxxxx/
drivers/pci/pcie/dpc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c
index 2b779bd1d861..4c2cfae27a08 100644
--- a/drivers/pci/pcie/dpc.c
+++ b/drivers/pci/pcie/dpc.c
@@ -477,6 +477,9 @@ static int dpc_probe(struct pcie_device *dev)
int status;
u16 cap;
+ if (!pdev->aer_cap)
+ return -ENOTSUPP;
+
if (!pcie_aer_is_native(pdev) && !pcie_ports_dpc_native)
return -ENOTSUPP;
--
2.43.0