Skip to content

Commit 852972a

Browse files
Matthew Garrettjbarnes993
authored andcommitted
ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe
The PCI SIG documentation for the _OSC OS/firmware handshaking interface states: "If the _OSC control method is absent from the scope of a host bridge device, then the operating system must not enable or attempt to use any features defined in this section for the hierarchy originated by the host bridge." The obvious interpretation of this is that the OS should not attempt to use PCIe hotplug, PME or AER - however, the specification also notes that an _OSC method is *required* for PCIe hierarchies, and experimental validation with An Alternative OS indicates that it doesn't use any PCIe functionality if the _OSC method is missing. That arguably means we shouldn't be using MSI or extended config space, but right now our problems seem to be limited to vendors being surprised when ASPM gets enabled on machines when other OSs refuse to do so. So, for now, let's just disable ASPM if the _OSC method doesn't exist or refuses to hand over PCIe capability control. Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
1 parent 3f579c3 commit 852972a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/acpi/pci_root.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <linux/pm_runtime.h>
3434
#include <linux/pci.h>
3535
#include <linux/pci-acpi.h>
36+
#include <linux/pci-aspm.h>
3637
#include <linux/acpi.h>
3738
#include <linux/slab.h>
3839
#include <acpi/acpi_bus.h>
@@ -543,6 +544,14 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
543544
if (flags != base_flags)
544545
acpi_pci_osc_support(root, flags);
545546

547+
status = acpi_pci_osc_control_set(root->device->handle,
548+
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
549+
550+
if (ACPI_FAILURE(status)) {
551+
printk(KERN_INFO "Unable to assume PCIe control: Disabling ASPM\n");
552+
pcie_no_aspm();
553+
}
554+
546555
pci_acpi_add_bus_pm_notifier(device, root->bus);
547556
if (device->wakeup.flags.run_wake)
548557
device_set_run_wake(root->bus->bridge, true);

0 commit comments

Comments
 (0)