* [PATCH] cpufreq: intel_pstate: Fix active mode setting from command line
@ 2020-07-13 13:58 Rafael J. Wysocki
2020-07-13 15:24 ` Doug Smythies
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-07-13 13:58 UTC (permalink / raw)
To: Linux PM; +Cc: Doug Smythies, LKML, Srinivas Pandruvada
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
If intel_pstate starts in the passive mode by default (that happens
when the processor in the system doesn't support HWP), passing
intel_pstate=active in the kernel command line doesn't work, so
fix that.
Fixes: 33aa46f252c7 ("cpufreq: intel_pstate: Use passive mode by default without HWP")
Reported-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/intel_pstate.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: linux-pm/drivers/cpufreq/intel_pstate.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/intel_pstate.c
+++ linux-pm/drivers/cpufreq/intel_pstate.c
@@ -2534,7 +2534,7 @@ static struct cpufreq_driver intel_cpufr
.name = "intel_cpufreq",
};
-static struct cpufreq_driver *default_driver = &intel_pstate;
+static struct cpufreq_driver *default_driver;
static void intel_pstate_driver_cleanup(void)
{
@@ -2828,6 +2828,7 @@ static int __init intel_pstate_init(void
hwp_active++;
hwp_mode_bdw = id->driver_data;
intel_pstate.attr = hwp_cpufreq_attrs;
+ default_driver = &intel_pstate;
goto hwp_cpu_matched;
}
} else {
@@ -2845,7 +2846,8 @@ static int __init intel_pstate_init(void
return -ENODEV;
}
/* Without HWP start in the passive mode. */
- default_driver = &intel_cpufreq;
+ if (!default_driver)
+ default_driver = &intel_cpufreq;
hwp_cpu_matched:
/*
@@ -2899,6 +2901,8 @@ static int __init intel_pstate_setup(cha
if (!strcmp(str, "disable")) {
no_load = 1;
+ } else if (!strcmp(str, "active")) {
+ default_driver = &intel_pstate;
} else if (!strcmp(str, "passive")) {
default_driver = &intel_cpufreq;
no_hwp = 1;
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] cpufreq: intel_pstate: Fix active mode setting from command line
2020-07-13 13:58 [PATCH] cpufreq: intel_pstate: Fix active mode setting from command line Rafael J. Wysocki
@ 2020-07-13 15:24 ` Doug Smythies
0 siblings, 0 replies; 2+ messages in thread
From: Doug Smythies @ 2020-07-13 15:24 UTC (permalink / raw)
To: 'Rafael J. Wysocki'
Cc: 'LKML', 'Srinivas Pandruvada', 'Linux PM'
Hi Rafael,
Thank you.
On 2020.07.13 06:59 Rafael J. Wysocki wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> If intel_pstate starts in the passive mode by default (that happens
> when the processor in the system doesn't support HWP), passing
> intel_pstate=active in the kernel command line doesn't work, so
> fix that.
>
> Fixes: 33aa46f252c7 ("cpufreq: intel_pstate: Use passive mode by default without HWP")
> Reported-by: Doug Smythies <dsmythies@telus.net>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Doug Smythies <dsmythies@telus.net>
> ---
> drivers/cpufreq/intel_pstate.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/intel_pstate.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/intel_pstate.c
> +++ linux-pm/drivers/cpufreq/intel_pstate.c
> @@ -2534,7 +2534,7 @@ static struct cpufreq_driver intel_cpufr
> .name = "intel_cpufreq",
> };
>
> -static struct cpufreq_driver *default_driver = &intel_pstate;
> +static struct cpufreq_driver *default_driver;
>
> static void intel_pstate_driver_cleanup(void)
> {
> @@ -2828,6 +2828,7 @@ static int __init intel_pstate_init(void
> hwp_active++;
> hwp_mode_bdw = id->driver_data;
> intel_pstate.attr = hwp_cpufreq_attrs;
> + default_driver = &intel_pstate;
> goto hwp_cpu_matched;
> }
> } else {
> @@ -2845,7 +2846,8 @@ static int __init intel_pstate_init(void
> return -ENODEV;
> }
> /* Without HWP start in the passive mode. */
> - default_driver = &intel_cpufreq;
> + if (!default_driver)
> + default_driver = &intel_cpufreq;
>
> hwp_cpu_matched:
> /*
> @@ -2899,6 +2901,8 @@ static int __init intel_pstate_setup(cha
>
> if (!strcmp(str, "disable")) {
> no_load = 1;
> + } else if (!strcmp(str, "active")) {
> + default_driver = &intel_pstate;
> } else if (!strcmp(str, "passive")) {
> default_driver = &intel_cpufreq;
> no_hwp = 1;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-13 15:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13 13:58 [PATCH] cpufreq: intel_pstate: Fix active mode setting from command line Rafael J. Wysocki
2020-07-13 15:24 ` Doug Smythies
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).