]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: disable ASPM per ACPI FADT setting
authorShaohua Li <shaohua.li@intel.com>
Mon, 13 Oct 2008 23:38:11 +0000 (19:38 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Oct 2008 21:13:24 +0000 (14:13 -0700)
commit 5fde244d39b88625ac578d83e6625138714de031 upstream

The ACPI FADT table includes an ASPM control bit. If the bit is set, do
not enable ASPM since it may indicate that the platform doesn't actually
support the feature.

Tested-by: Jack Howarth <howarth@bromo.msbb.uc.edu>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pci-acpi.c
drivers/pci/pcie/aspm.c
include/acpi/actbl.h
include/linux/pci-aspm.h

index 9d6fc8e6285d0c557a5e1778e468f49066ff4da5..c2dc92b5fa75ba293e000149eb69140fa6233f4f 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/module.h>
+#include <linux/pci-aspm.h>
 #include <acpi/acpi.h>
 #include <acpi/acnamesp.h>
 #include <acpi/acresrc.h>
@@ -394,6 +395,12 @@ static int __init acpi_pci_init(void)
                printk(KERN_INFO"ACPI FADT declares the system doesn't support MSI, so disable it\n");
                pci_no_msi();
        }
+
+       if (acpi_gbl_FADT.boot_flags & BAF_PCIE_ASPM_CONTROL) {
+               printk(KERN_INFO"ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n");
+               pcie_no_aspm();
+       }
+
        ret = register_acpi_bus_type(&acpi_pci_bus);
        if (ret)
                return 0;
index f82495583e63c123a89a41e23af1b658ac509a62..759c51a4e399dc43929ba39d39a47c5a74042ec5 100644 (file)
@@ -808,6 +808,11 @@ static int __init pcie_aspm_disable(char *str)
 
 __setup("pcie_noaspm", pcie_aspm_disable);
 
+void pcie_no_aspm(void)
+{
+       aspm_disabled = 1;
+}
+
 #ifdef CONFIG_ACPI
 #include <acpi/acpi_bus.h>
 #include <linux/pci-acpi.h>
index 1ebbe883f7865576d022280a8da0f979e6a3278d..13a3d9ad92db79f57c2063f60be9302d3525e77c 100644 (file)
@@ -277,6 +277,7 @@ enum acpi_prefered_pm_profiles {
 #define BAF_LEGACY_DEVICES              0x0001
 #define BAF_8042_KEYBOARD_CONTROLLER    0x0002
 #define BAF_MSI_NOT_SUPPORTED           0x0008
+#define BAF_PCIE_ASPM_CONTROL           0x0010
 
 #define FADT2_REVISION_ID               3
 #define FADT2_MINUS_REVISION_ID         2
index a1a1e618e996ba16dbc69e56a78d127829a6fd1a..91ba0b338b472905e05ca2ba7676a33bc2a6530d 100644 (file)
@@ -27,6 +27,7 @@ extern void pcie_aspm_init_link_state(struct pci_dev *pdev);
 extern void pcie_aspm_exit_link_state(struct pci_dev *pdev);
 extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
 extern void pci_disable_link_state(struct pci_dev *pdev, int state);
+extern void pcie_no_aspm(void);
 #else
 static inline void pcie_aspm_init_link_state(struct pci_dev *pdev)
 {
@@ -40,6 +41,10 @@ static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev)
 static inline void pci_disable_link_state(struct pci_dev *pdev, int state)
 {
 }
+
+static inline void pcie_no_aspm(void)
+{
+}
 #endif
 
 #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */