aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2012-02-03 10:18:13 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-02-17 12:22:03 -0500
commitad71c96213a68dfe6d761e3ff7ac7ac267fd612a (patch)
treee1586751c7249035c128de60a5721aafa997e2d5 /drivers/pci/pcie
parentf67fd55fa96f7d7295b43ffbc4a97d8f55e473aa (diff)
PCI: pcie: Add support for setting default ASPM policy
Distributions may wish to provide different defaults for PCIE ASPM depending on their target audience. Provide a configuration option for choosing the default policy. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r--drivers/pci/pcie/Kconfig25
-rw-r--r--drivers/pci/pcie/aspm.c8
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
index 72962cc92e0a..6c8bc5809787 100644
--- a/drivers/pci/pcie/Kconfig
+++ b/drivers/pci/pcie/Kconfig
@@ -55,6 +55,31 @@ config PCIEASPM_DEBUG
55 This enables PCI Express ASPM debug support. It will add per-device 55 This enables PCI Express ASPM debug support. It will add per-device
56 interface to control ASPM. 56 interface to control ASPM.
57 57
58choice
59 prompt "Default ASPM policy"
60 default PCIEASPM_DEFAULT
61 depends on PCIEASPM
62
63config PCIEASPM_DEFAULT
64 bool "BIOS default"
65 depends on PCIEASPM
66 help
67 Use the BIOS defaults for PCI Express ASPM.
68
69config PCIEASPM_POWERSAVE
70 bool "Powersave"
71 depends on PCIEASPM
72 help
73 Enable PCI Express ASPM L0s and L1 where possible, even if the
74 BIOS did not.
75
76config PCIEASPM_PERFORMANCE
77 bool "Performance"
78 depends on PCIEASPM
79 help
80 Disable PCI Express ASPM L0s and L1, even if the BIOS enabled them.
81endchoice
82
58config PCIE_PME 83config PCIE_PME
59 def_bool y 84 def_bool y
60 depends on PCIEPORTBUS && PM_RUNTIME && EXPERIMENTAL && ACPI 85 depends on PCIEPORTBUS && PM_RUNTIME && EXPERIMENTAL && ACPI
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 1cfbf228fbb1..a0de5e123046 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -76,7 +76,15 @@ static LIST_HEAD(link_list);
76#define POLICY_DEFAULT 0 /* BIOS default setting */ 76#define POLICY_DEFAULT 0 /* BIOS default setting */
77#define POLICY_PERFORMANCE 1 /* high performance */ 77#define POLICY_PERFORMANCE 1 /* high performance */
78#define POLICY_POWERSAVE 2 /* high power saving */ 78#define POLICY_POWERSAVE 2 /* high power saving */
79
80#ifdef CONFIG_PCIEASPM_PERFORMANCE
81static int aspm_policy = POLICY_PERFORMANCE;
82#elif defined CONFIG_PCIEASPM_POWERSAVE
83static int aspm_policy = POLICY_POWERSAVE;
84#else
79static int aspm_policy; 85static int aspm_policy;
86#endif
87
80static const char *policy_str[] = { 88static const char *policy_str[] = {
81 [POLICY_DEFAULT] = "default", 89 [POLICY_DEFAULT] = "default",
82 [POLICY_PERFORMANCE] = "performance", 90 [POLICY_PERFORMANCE] = "performance",