From da0d9fda3743769484d3db5a17a121599076e869 Mon Sep 17 00:00:00 2001 From: Dirk Brandewie Date: Thu, 14 Feb 2013 22:55:34 +0100 Subject: cpufreq / intel_pstate: Change to disallow module build Load order is important in order for intel_pstate to take over as the default scaling driver from acpi-cpufreq. If both are built-in, acpi-cpufreq uses late_initcall() and intel_pstate uses device_initcall() so it will be able to register as the scaling before acpi-cpufreq for the processors supported by intel_pstate. If acpi-cpufreq is built as a module then intel_pstate still gets first option to become the scaling driver. Signed-off-by: Dirk Brandewie Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/Kconfig.x86 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 index 6aa7053ce2ef..98e5abbe8f26 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -3,7 +3,7 @@ # config X86_INTEL_PSTATE - tristate "Intel P state control" + bool "Intel P state control" depends on X86 help This driver provides a P state for Intel core processors. @@ -13,11 +13,6 @@ config X86_INTEL_PSTATE When this driver is enabled it will become the perferred scaling driver for Sandy bridge processors. - Note: This driver should be built with the same settings as - the other scaling drivers configured into the system - (module/built-in) in order for the driver to register itself - as the scaling driver on the system. - If in doubt, say N. config X86_PCC_CPUFREQ -- cgit v1.2.1 From 6be264986152c498562f26b15ed73c70aa37ce48 Mon Sep 17 00:00:00 2001 From: Dirk Brandewie Date: Fri, 15 Feb 2013 22:55:10 +0100 Subject: cpufreq / intel_pstate: Add kernel command line option disable intel_pstate. When intel_pstate is configured into the kernel it will become the preferred scaling driver for processors that it supports. Allow the user to override this by adding: intel_pstate=disable on the kernel command line. Signed-off-by: Dirk Brandewie Signed-off-by: Rafael J. Wysocki --- Documentation/kernel-parameters.txt | 5 +++++ drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 363e348bff9b..b335c456feb9 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1131,6 +1131,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 0 disables intel_idle and fall back on acpi_idle. 1 to 6 specify maximum depth of C-state. + intel_pstate= [X86] + disable + Do not enable intel_pstate as the default + scaling driver for the supported processors + intremap= [X86-64, Intel-IOMMU] on enable Interrupt Remapping (default) off disable Interrupt Remapping diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index e87996355da0..096fde0ebcb5 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -773,11 +773,16 @@ static void intel_pstate_exit(void) } module_exit(intel_pstate_exit); +static int __initdata no_load; + static int __init intel_pstate_init(void) { int rc = 0; const struct x86_cpu_id *id; + if (no_load) + return -ENODEV; + id = x86_match_cpu(intel_pstate_cpu_ids); if (!id) return -ENODEV; @@ -802,6 +807,17 @@ out: } device_initcall(intel_pstate_init); +static int __init intel_pstate_setup(char *str) +{ + if (!str) + return -EINVAL; + + if (!strcmp(str, "disable")) + no_load = 1; + return 0; +} +early_param("intel_pstate", intel_pstate_setup); + MODULE_AUTHOR("Dirk Brandewie "); MODULE_DESCRIPTION("'intel_pstate' - P state driver Intel Core processors"); MODULE_LICENSE("GPL"); -- cgit v1.2.1