PCI: add an option to allow ASPM enabled forcibly

A new option, pcie_aspm=force, will force ASPM to be enabled, even on system
with PCIe 1.0 devices.

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 d6d38574 149e1637

+14 -6
+14 -6
drivers/pci/pcie/aspm.c
··· 55 55 struct endpoint_state endpoints[8]; 56 56 }; 57 57 58 - static int aspm_disabled; 58 + static int aspm_disabled, aspm_force; 59 59 static DEFINE_MUTEX(aspm_lock); 60 60 static LIST_HEAD(link_list); 61 61 ··· 527 527 */ 528 528 pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP, 529 529 &reg32); 530 - if (!(reg32 & PCI_EXP_DEVCAP_RBER)) { 530 + if (!(reg32 & PCI_EXP_DEVCAP_RBER && !aspm_force)) { 531 531 printk("Pre-1.1 PCIe device detected, " 532 - "disable ASPM for %s\n", pci_name(pdev)); 532 + "disable ASPM for %s. It can be enabled forcedly" 533 + " with 'pcie_aspm=force'\n", pci_name(pdev)); 533 534 return -EINVAL; 534 535 } 535 536 } ··· 816 815 817 816 static int __init pcie_aspm_disable(char *str) 818 817 { 819 - aspm_disabled = 1; 818 + if (!strcmp(str, "off")) { 819 + aspm_disabled = 1; 820 + printk(KERN_INFO "PCIe ASPM is disabled\n"); 821 + } else if (!strcmp(str, "force")) { 822 + aspm_force = 1; 823 + printk(KERN_INFO "PCIe ASPM is forcedly enabled\n"); 824 + } 820 825 return 1; 821 826 } 822 827 823 - __setup("pcie_noaspm", pcie_aspm_disable); 828 + __setup("pcie_aspm=", pcie_aspm_disable); 824 829 825 830 void pcie_no_aspm(void) 826 831 { 827 - aspm_disabled = 1; 832 + if (!aspm_force) 833 + aspm_disabled = 1; 828 834 } 829 835 830 836 #ifdef CONFIG_ACPI