aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2008-07-22 22:32:42 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-07-28 17:57:30 -0400
commitd6d385743463f38a0da899cd4607e526ad9a049f (patch)
tree3d5de148d1cf56e58c6321511adaf8078d9046c0
parent149e16372a2066c5474d8a8db9b252afd57eb427 (diff)
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>
-rw-r--r--drivers/pci/pcie/aspm.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 704605298c5..9a7c9e1408a 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -55,7 +55,7 @@ struct pcie_link_state {
55 struct endpoint_state endpoints[8]; 55 struct endpoint_state endpoints[8];
56}; 56};
57 57
58static int aspm_disabled; 58static int aspm_disabled, aspm_force;
59static DEFINE_MUTEX(aspm_lock); 59static DEFINE_MUTEX(aspm_lock);
60static LIST_HEAD(link_list); 60static LIST_HEAD(link_list);
61 61
@@ -527,9 +527,10 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
527 */ 527 */
528 pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP, 528 pci_read_config_dword(child_dev, child_pos + PCI_EXP_DEVCAP,
529 &reg32); 529 &reg32);
530 if (!(reg32 & PCI_EXP_DEVCAP_RBER)) { 530 if (!(reg32 & PCI_EXP_DEVCAP_RBER && !aspm_force)) {
531 printk("Pre-1.1 PCIe device detected, " 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 return -EINVAL; 534 return -EINVAL;
534 } 535 }
535 } 536 }
@@ -815,15 +816,22 @@ void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
815 816
816static int __init pcie_aspm_disable(char *str) 817static int __init pcie_aspm_disable(char *str)
817{ 818{
818 aspm_disabled = 1; 819 if (!strcmp(str, "off")) {
820 aspm_disabled = 1;
821 printk(KERN_INFO "PCIe ASPM is disabled\n");
822 } else if (!strcmp(str, "force")) {
823 aspm_force = 1;
824 printk(KERN_INFO "PCIe ASPM is forcedly enabled\n");
825 }
819 return 1; 826 return 1;
820} 827}
821 828
822__setup("pcie_noaspm", pcie_aspm_disable); 829__setup("pcie_aspm=", pcie_aspm_disable);
823 830
824void pcie_no_aspm(void) 831void pcie_no_aspm(void)
825{ 832{
826 aspm_disabled = 1; 833 if (!aspm_force)
834 aspm_disabled = 1;
827} 835}
828 836
829#ifdef CONFIG_ACPI 837#ifdef CONFIG_ACPI