mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI/portdrv: Do not advertise DPC on ports without an AER capability
@ 2026-11-16 21:39 Jason Perlow
  2026-11-16 22:05 ` Lukas Wunner
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Perlow @ 2026-11-16 21:39 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Darshit Shah, Kuppuswamy Sathyanarayanan, linux-kernel

Commit 97ca178c899d ("PCI/DPC: Allow DPC on all Downstream Ports when OS
controls AER") makes get_port_device_capability() advertise the DPC
service on any port with a DPC capability when the host bridge owns AER.
It dropped the earlier per-port test for an AER capability.

dpc_probe() still returns -ENOTSUPP unless pcie_aer_is_native() is true
or pcie_ports=dpc-native is set, and pcie_aer_is_native() is never true
for a port without an AER capability.  Such ports now get a DPC service
device that can never bind, and every boot logs an error for each of
them.  For example, on a MacBookPro16,1 the Cannon Lake PCH root ports
have DPC but no AER capability:

   dpc 0000:00:1b.0:pcie008: probe with driver dpc failed with error -524
   dpc 0000:00:1c.0:pcie008: probe with driver dpc failed with error -524

Advertise the DPC service under the same condition dpc_probe() uses, so
a port without an AER capability no longer gets a DPC service device.
pcie_ports=dpc-native still enables DPC regardless of AER.

Tested on two MacBookPro16,1 with v7.3.4 and v7.4-rc3 based kernels
carrying an equivalent change (testing dev->aer_cap): the ports no longer
get a DPC service device and the errors are gone.  The patch as posted
builds portdrv.o with CONFIG_PCIEAER=y and with CONFIG_PCIEAER=n.

Fixes: 97ca178c899d ("PCI/DPC: Allow DPC on all Downstream Ports when OS 
controls AER")
Cc: stable@vger.kernel.org # v7.3+
Signed-off-by: Jason Perlow <jperlow@gmail.com>
---
  drivers/pci/pcie/portdrv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c
index 32fc623dd4..e7358e164e 100644
--- a/drivers/pci/pcie/portdrv.c
+++ b/drivers/pci/pcie/portdrv.c
@@ -264,7 +264,7 @@ static int get_port_device_capability(struct pci_dev 
*dev)
  	 */
  	if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) &&
  	    pci_aer_available() &&
-	    (pcie_ports_dpc_native || host->native_aer))
+	    (pcie_ports_dpc_native || pcie_aer_is_native(dev)))
  		services |= PCIE_PORT_SERVICE_DPC;
   	/* Enable bandwidth control if more than one speed is supported. */
-- 
2.56.0


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

* Re: [PATCH] PCI/portdrv: Do not advertise DPC on ports without an AER capability
  2026-11-16 21:39 [PATCH] PCI/portdrv: Do not advertise DPC on ports without an AER capability Jason Perlow
@ 2026-11-16 22:05 ` Lukas Wunner
  2026-11-16 22:08   ` Perlow, Jason
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Wunner @ 2026-11-16 22:05 UTC (permalink / raw)
  To: Jason Perlow
  Cc: Bjorn Helgaas, linux-pci, Darshit Shah,
	Kuppuswamy Sathyanarayanan, linux-kernel

On Mon, Nov 16, 2026 at 04:39:23PM -0500, Jason Perlow wrote:
> Commit 97ca178c899d ("PCI/DPC: Allow DPC on all Downstream Ports when OS
> controls AER") makes get_port_device_capability() advertise the DPC
> service on any port with a DPC capability when the host bridge owns AER.
> It dropped the earlier per-port test for an AER capability.
> 
> dpc_probe() still returns -ENOTSUPP unless pcie_aer_is_native() is true
> or pcie_ports=dpc-native is set, and pcie_aer_is_native() is never true
> for a port without an AER capability.  Such ports now get a DPC service
> device that can never bind, and every boot logs an error for each of
> them.  For example, on a MacBookPro16,1 the Cannon Lake PCH root ports
> have DPC but no AER capability:
> 
>   dpc 0000:00:1b.0:pcie008: probe with driver dpc failed with error -524
>   dpc 0000:00:1c.0:pcie008: probe with driver dpc failed with error -524

DPC does not mandate AER support, so the condition in
get_port_device_capability (which you're changing) is correct whereas
the condition in dpc_probe() is wrong.  There's a patch pending which
removes it:

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

I'll respin the patch shortly.  The patch is tagged for stable.
If you can't live with the error message until the patch gets
picked up by the kernel version you're using, replace the
-ENOTSUPP with -ENODEV to silence the error.

Thanks,

Lukas

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

* Re: [PATCH] PCI/portdrv: Do not advertise DPC on ports without an AER capability
  2026-11-16 22:05 ` Lukas Wunner
@ 2026-11-16 22:08   ` Perlow, Jason
  0 siblings, 0 replies; 3+ messages in thread
From: Perlow, Jason @ 2026-11-16 22:08 UTC (permalink / raw)
  To: Lukas Wunner
  Cc: Bjorn Helgaas, linux-pci, Darshit Shah,
	Kuppuswamy Sathyanarayanan, linux-kernel

>
>
> DPC does not mandate AER support, so the condition in
> get_port_device_capability (which you're changing) is correct whereas
> the condition in dpc_probe() is wrong.  There's a patch pending which
> removes it:
>
> https://lore.kernel.org/r/2ce502e5caa57db01e0a7bbc781210b66b73bec8.1790531238.git.lukas@wunner.de/
>
> I'll respin the patch shortly.  The patch is tagged for stable.
> If you can't live with the error message until the patch gets
> picked up by the kernel version you're using, replace the
> -ENOTSUPP with -ENODEV to silence the error.
>
> Thanks,
>
> Lukas


Thanks!

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

end of thread, other threads:[~2026-11-16 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 21:39 [PATCH] PCI/portdrv: Do not advertise DPC on ports without an AER capability Jason Perlow
2026-11-16 22:05 ` Lukas Wunner
2026-11-16 22:08   ` Perlow, Jason

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

all inboxes | Powered by JetHome®