[RFC][PATCH] PCI / PCIe: Ask BIOS for control of all native services simultaneously

Date

Sun, 25 Jul 2010 01:05:23 +0200

From: Rafael J. Wysocki <rjw@sisk.pl>

It turns out that asking ACPI BIOS, through _OSC, for control of eachPCIe port native service individually sometimes confuses the BIOS ifone sevice is requested while the others are not (eg. requestingcontrol of the native PCIe PME without requesting control of thenative PCIe hot-plug at the same time leads to interrupt storms onsome systems).

For this reason rework the PCIe port driver so that control of allnative services is requested simultaneously and pcie_portdrv_probe()fails if the BIOS refuses to satisfy that request. Make it possibleto override this behavior using a new command line switch pcie_ports=that can be set to 'auto' (ask the BIOS, the default), 'native'(use the PCIe native services regardless of the BIOS response thethe control request), or 'compat' (do not use the PCIe nativeservices at all).

Accordingly, rework the existing PCIe port service drivers so thatthey don't request control of the services directly.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>---

Hi,

This is a total RFC, I didn't have the time to really test it. Also, it'smissing documentation updates related to the added/changed command lineoptions.

/*- * If set, this switch will prevent the PCIe root port PME service driver from- * being registered. Consequently, the interrupt-based PCIe PME signaling will- * not be used by any PCIe root ports in that case.- */-static bool pcie_pme_disabled = true;--/*- * The PCI Express Base Specification 2.0, Section 6.1.8, states the following:- * "In order to maintain compatibility with non-PCI Express-aware system- * software, system power management logic must be configured by firmware to use- * the legacy mechanism of signaling PME by default. PCI Express-aware system- * software must notify the firmware prior to enabling native, interrupt-based- * PME signaling." However, if the platform doesn't provide us with a suitable- * notification mechanism or the notification fails, it is not clear whether or- * not we are supposed to use the interrupt-based PCIe PME signaling. The- * switch below can be used to indicate the desired behaviour. When set, it- * will make the kernel use the interrupt-based PCIe PME signaling regardless of- * the platform notification status, although the kernel will attempt to notify- * the platform anyway. When unset, it will prevent the kernel from using the- * the interrupt-based PCIe PME signaling if the platform notification fails,- * which is the default.- */-static bool pcie_pme_force_enable;--/* * If this switch is set, MSI will not be used for PCIe PME signaling. This * causes the PCIe port driver to use INTx interrupts only, but it turns out * that using MSI for PCIe PME signaling doesn't play well with PCIe PME-based@@ -64,38 +39,13 @@ bool pcie_pme_msi_disabled;