PCI/portdrv: Allow AER service only for Root Ports & RCECs
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 9 Dec 2022 17:01:00 +0000 (11:01 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 10 Dec 2022 16:26:40 +0000 (10:26 -0600)
commitd8d2b65a940bb497749d66bdab59b530901d3854
tree30d37541bedbcd2ed96504fc29bc62d71c6005a5
parent461a65d7d1a4f56b97c9115eda3e8619516f40fb
PCI/portdrv: Allow AER service only for Root Ports & RCECs

Previously portdrv allowed the AER service for any device with an AER
capability (assuming Linux had control of AER) even though the AER service
driver only attaches to Root Port and RCECs.

Because get_port_device_capability() included AER for non-RP, non-RCEC
devices, we tried to initialize the AER IRQ even though these devices
don't generate AER interrupts.

Intel DG1 and DG2 discrete graphics cards contain a switch leading to a
GPU.  The switch supports AER but not MSI, so initializing an AER IRQ
failed, and portdrv failed to claim the switch port at all.  The GPU itself
could be suspended, but the switch could not be put in a low-power state
because it had no driver.

Don't allow the AER service on non-Root Port, non-Root Complex Event
Collector devices.  This means we won't enable Bus Mastering if the device
doesn't require MSI, the AER service will not appear in sysfs, and the AER
service driver will not bind to the device.

Link: https://lore.kernel.org/r/20221207084105.84947-1-mika.westerberg@linux.intel.com
Link: https://lore.kernel.org/r/20221210002922.1749403-1-helgaas@kernel.org
Based-on-patch-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
drivers/pci/pcie/portdrv.c