public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI
@ 2025-11-28 12:20 Darshit Shah
  2025-11-28 17:07 ` Lukas Wunner
  2025-12-09  0:30 ` [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI Bjorn Helgaas
  0 siblings, 2 replies; 9+ messages in thread
From: Darshit Shah @ 2025-11-28 12:20 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner, Krzysztof Wilczyński,
	Kuppuswamy Sathyanarayanan, Jonathan Cameron, Darshit Shah,
	darnir, Feng Tang
  Cc: linux-pci, linux-kernel, nh-open-source

Previously portdrv tried to prevent non-Root Port (RP) and non-Root
Complex Event Collector (RCEC) devices from enabling AER capability.
This was done because some switches enable AER but do not support MSI.
Hence, trying to initialize the AER IRQ for such devices would fail and
Linux would fail to claim the switch port entirely.

However, it is possible to have switches upstream of an endpoint that
support MSI and AER. Without AER capability being enabled on such
a switch, portdrv will refuse to enable the DPC capability as well,
preventing a PCIe error on an endpoint from being handled by the switch.

Allow enabling the AER service on non-RP, non-RCEC devices if they still
support both AER and MSI. This allows switches upstream of an endpoint
to generate and handle DPC events.
Fixes: d8d2b65a940b ("PCI/portdrv: Allow AER service only for Root Ports & RCECs")
Signed-off-by: Darshit Shah <darnshah@amazon.de>
---
 drivers/pci/pcie/portdrv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c
index d1b68c18444f..41326bbcd295 100644
--- a/drivers/pci/pcie/portdrv.c
+++ b/drivers/pci/pcie/portdrv.c
@@ -237,8 +237,8 @@ static int get_port_device_capability(struct pci_dev *dev)
 	}
 
 #ifdef CONFIG_PCIEAER
-	if ((pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT ||
-             pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC) &&
+	if ((dev->msi_cap || pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT ||
+	     pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC) &&
 	    dev->aer_cap && pci_aer_available() &&
 	    (pcie_ports_native || host->native_aer))
 		services |= PCIE_PORT_SERVICE_AER;
-- 
2.47.3




Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Christof Hellmis
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597


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

end of thread, other threads:[~2026-02-28 23:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28 12:20 [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI Darshit Shah
2025-11-28 17:07 ` Lukas Wunner
2025-12-08 11:25   ` [PATCH v2 0/1] " Darshit Shah
2025-12-08 11:25     ` [PATCH v2 1/1] drivers/pci: Decouple DPC from AER service Darshit Shah
2025-12-09  7:45       ` Lukas Wunner
2025-12-11 16:42         ` [PATCH v3] " Darshit Shah
2026-02-28 23:59           ` Darshit Shah
2025-12-09 15:29       ` [PATCH v2 1/1] " Sathyanarayanan Kuppuswamy
2025-12-09  0:30 ` [PATCH] drivers/pci: Allow attaching AER to non-RP devices that support MSI Bjorn Helgaas

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