PCI: disable ASPM per ACPI FADT setting

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>

authored by Shaohua Li and committed by Jesse Barnes 5fde244d ce6fce42

+18
+7
drivers/pci/pci-acpi.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/pci.h> 13 13 #include <linux/module.h> 14 + #include <linux/pci-aspm.h> 14 15 #include <acpi/acpi.h> 15 16 #include <acpi/acnamesp.h> 16 17 #include <acpi/acresrc.h> ··· 373 372 printk(KERN_INFO"ACPI FADT declares the system doesn't support MSI, so disable it\n"); 374 373 pci_no_msi(); 375 374 } 375 + 376 + if (acpi_gbl_FADT.boot_flags & BAF_PCIE_ASPM_CONTROL) { 377 + printk(KERN_INFO"ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n"); 378 + pcie_no_aspm(); 379 + } 380 + 376 381 ret = register_acpi_bus_type(&acpi_pci_bus); 377 382 if (ret) 378 383 return 0;
+5
drivers/pci/pcie/aspm.c
··· 808 808 809 809 __setup("pcie_noaspm", pcie_aspm_disable); 810 810 811 + void pcie_no_aspm(void) 812 + { 813 + aspm_disabled = 1; 814 + } 815 + 811 816 #ifdef CONFIG_ACPI 812 817 #include <acpi/acpi_bus.h> 813 818 #include <linux/pci-acpi.h>
+1
include/acpi/actbl.h
··· 277 277 #define BAF_LEGACY_DEVICES 0x0001 278 278 #define BAF_8042_KEYBOARD_CONTROLLER 0x0002 279 279 #define BAF_MSI_NOT_SUPPORTED 0x0008 280 + #define BAF_PCIE_ASPM_CONTROL 0x0010 280 281 281 282 #define FADT2_REVISION_ID 3 282 283 #define FADT2_MINUS_REVISION_ID 2
+5
include/linux/pci-aspm.h
··· 27 27 extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); 28 28 extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); 29 29 extern void pci_disable_link_state(struct pci_dev *pdev, int state); 30 + extern void pcie_no_aspm(void); 30 31 #else 31 32 static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) 32 33 { ··· 39 38 { 40 39 } 41 40 static inline void pci_disable_link_state(struct pci_dev *pdev, int state) 41 + { 42 + } 43 + 44 + static inline void pcie_no_aspm(void) 42 45 { 43 46 } 44 47 #endif