summaryrefslogtreecommitdiffstats
path: root/pci-acpi-disable-aspm-if-no-osc.patch
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-07-29 17:18:45 -0700
committerJesse Keating <jkeating@redhat.com>2010-07-29 17:18:45 -0700
commit2f82dda4a9bf41e64e864889bf06564bdf826e25 (patch)
tree118a7b483ae5de4dbf83d20001302f1404866ef0 /pci-acpi-disable-aspm-if-no-osc.patch
parent64ba2e5ffde5f2418eb26c700cb0ab62b04e5013 (diff)
downloaddom0-kernel-2f82dda4a9bf41e64e864889bf06564bdf826e25.tar.gz
dom0-kernel-2f82dda4a9bf41e64e864889bf06564bdf826e25.tar.xz
dom0-kernel-2f82dda4a9bf41e64e864889bf06564bdf826e25.zip
initial srpm import
Diffstat (limited to 'pci-acpi-disable-aspm-if-no-osc.patch')
-rw-r--r--pci-acpi-disable-aspm-if-no-osc.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/pci-acpi-disable-aspm-if-no-osc.patch b/pci-acpi-disable-aspm-if-no-osc.patch
new file mode 100644
index 0000000..82f6a9c
--- /dev/null
+++ b/pci-acpi-disable-aspm-if-no-osc.patch
@@ -0,0 +1,55 @@
+From: Matthew Garrett <mjg@redhat.com>
+Subject: ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe
+
+ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe
+
+[ backport to 2.6.32 ]
+
+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.
+
+Signed-off-by: Matthew Garrett <mjg@redhat.com>
+---
+
+diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
+index 4eac593..1f67057 100644
+--- a/drivers/acpi/pci_root.c
++++ b/drivers/acpi/pci_root.c
+@@ -33,6 +33,7 @@
+ #include <linux/pm.h>
+ #include <linux/pci.h>
+ #include <linux/pci-acpi.h>
++#include <linux/pci-aspm.h>
+ #include <linux/acpi.h>
+ #include <acpi/acpi_bus.h>
+ #include <acpi/acpi_drivers.h>
+@@ -543,6 +544,14 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
+ if (flags != base_flags)
+ acpi_pci_osc_support(root, flags);
+
++ status = acpi_pci_osc_control_set(root->device->handle,
++ 0);
++
++ if (status == AE_NOT_EXIST) {
++ printk(KERN_INFO "Unable to assume PCIe control: Disabling ASPM\n");
++ pcie_no_aspm();
++ }
++
+ return 0;
+
+ end: \ No newline at end of file