Skip to content

Commit 2264fca

Browse files
oohalgregkh
authored andcommitted
powerpc/powernv: Disable native PCIe port management
commit 9d72dce upstream. On PowerNV the PCIe topology is (currently) managed by the powernv platform code in Linux in cooperation with the platform firmware. Linux's native PCIe port service drivers operate independently of both and this can cause problems. The main issue is that the portbus driver will conflict with the platform specific hotplug driver (pnv_php) over ownership of the MSI used to notify the host when a hotplug event occurs. The portbus driver claims this MSI on behalf of the individual port services because the same interrupt is used for hotplug events, PMEs (on root ports), and link bandwidth change notifications. The portbus driver will always claim the interrupt even if the individual port service drivers, such as pciehp, are compiled out. The second, bigger, problem is that the hotplug port service driver fundamentally does not work on PowerNV. The platform assumes that all PCI devices have a corresponding arch-specific handle derived from the DT node for the device (pci_dn) and without one the platform will not allow a PCI device to be enabled. This problem is largely due to historical baggage, but it can't be resolved without significant re-factoring of the platform PCI support. We can fix these problems in the interim by setting the "pcie_ports_disabled" flag during platform initialisation. The flag indicates the platform owns the PCIe ports which stops the portbus driver from being registered. This does have the side effect of disabling all port services drivers that is: AER, PME, BW notifications, hotplug, and DPC. However, this is not a huge disadvantage on PowerNV since these services are either unused or handled through other means. Fixes: 6672515 ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver") Signed-off-by: Oliver O'Halloran <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2faf9f4 commit 2264fca

File tree

1 file changed

+17
-0
lines changed
  • arch/powerpc/platforms/powernv

1 file changed

+17
-0
lines changed

arch/powerpc/platforms/powernv/pci.c

+17
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,23 @@ void __init pnv_pci_init(void)
945945
if (!firmware_has_feature(FW_FEATURE_OPAL))
946946
return;
947947

948+
#ifdef CONFIG_PCIEPORTBUS
949+
/*
950+
* On PowerNV PCIe devices are (currently) managed in cooperation
951+
* with firmware. This isn't *strictly* required, but there's enough
952+
* assumptions baked into both firmware and the platform code that
953+
* it's unwise to allow the portbus services to be used.
954+
*
955+
* We need to fix this eventually, but for now set this flag to disable
956+
* the portbus driver. The AER service isn't required since that AER
957+
* events are handled via EEH. The pciehp hotplug driver can't work
958+
* without kernel changes (and portbus binding breaks pnv_php). The
959+
* other services also require some thinking about how we're going
960+
* to integrate them.
961+
*/
962+
pcie_ports_disabled = true;
963+
#endif
964+
948965
/* Look for IODA IO-Hubs. */
949966
for_each_compatible_node(np, NULL, "ibm,ioda-hub") {
950967
pnv_pci_init_ioda_hub(np);

0 commit comments

Comments
 (0)