Hi,
On 9/27/2026 11:02 AM, Lukas Wunner wrote:
> 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")
I don't think 708b20003624 changed behavior here. At the time,
get_port_device_capability() only instantiated the DPC service if
pcie_ports_dpc_native was set or the AER service was instantiated,
and the latter required dev->aer_cap and native AER control:
if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) &&
pci_aer_available() &&
(pcie_ports_dpc_native || (services & PCIE_PORT_SERVICE_AER)))
services |= PCIE_PORT_SERVICE_DPC;
So without dpc-native, the pcie_aer_is_native() check in dpc_probe()
could never fail, and with dpc-native it was bypassed.
The check only became effective with 97ca178c899d ("PCI/DPC: Allow DPC
on all Downstream Ports when OS controls AER"), which replaced
"services & PCIE_PORT_SERVICE_AER" with "host->native_aer". Since then
a DPC service is instantiated on AER-incapable ports, but dpc_probe()
rejects it.
So I think this should rather be:
Fixes: 97ca178c899d ("PCI/DPC: Allow DPC on all Downstream Ports when OS
controls AER")
Also, for stable kernels, is there any way to note that this patch needs
to be picked with patch 1. Otherwise DPC driver might access AER config
without aer_cap.
Otherwise it looks good.
Reviewed-by: Kuppuswamy Sathyanarayanan
<[email protected]>
> Signed-off-by: Lukas Wunner <[email protected]>
> Cc: [email protected] # 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 793a799053f1..104ff2b91f1f 100644
> --- a/drivers/pci/pcie/dpc.c
> +++ b/drivers/pci/pcie/dpc.c
> @@ -474,9 +474,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);
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer