aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-06-22 11:25:43 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-07-30 12:29:17 -0400
commit852972acff8f10f3a15679be2059bb94916cba5d (patch)
tree2a181930b169324d7f2b1ee96bba26b4083aed23 /drivers/acpi/pci_root.c
parent3f579c340fe6d6bdd8c6f9f144e7c3b85d4174ec (diff)
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 <rjw@sisk.pl> Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 4eac59393edc..1f67057af2a5 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -33,6 +33,7 @@
33#include <linux/pm_runtime.h> 33#include <linux/pm_runtime.h>
34#include <linux/pci.h> 34#include <linux/pci.h>
35#include <linux/pci-acpi.h> 35#include <linux/pci-acpi.h>
36#include <linux/pci-aspm.h>
36#include <linux/acpi.h> 37#include <linux/acpi.h>
37#include <linux/slab.h> 38#include <linux/slab.h>
38#include <acpi/acpi_bus.h> 39#include <acpi/acpi_bus.h>
@@ -543,6 +544,14 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
543 if (flags != base_flags) 544 if (flags != base_flags)
544 acpi_pci_osc_support(root, flags); 545 acpi_pci_osc_support(root, flags);
545 546
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
546 pci_acpi_add_bus_pm_notifier(device, root->bus); 555 pci_acpi_add_bus_pm_notifier(device, root->bus);
547 if (device->wakeup.flags.run_wake) 556 if (device->wakeup.flags.run_wake)
548 device_set_run_wake(root->bus->bridge, true); 557 device_set_run_wake(root->bus->bridge, true);