Skip to content

Commit 39a188b

Browse files
committed
cpufreq: intel_pstate: Fix active mode setting from command line
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: 33aa46f ("cpufreq: intel_pstate: Use passive mode by default without HWP") Reported-by: Doug Smythies <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Doug Smythies <[email protected]>
1 parent 11ba468 commit 39a188b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ static struct cpufreq_driver intel_cpufreq = {
24642464
.name = "intel_cpufreq",
24652465
};
24662466

2467-
static struct cpufreq_driver *default_driver = &intel_pstate;
2467+
static struct cpufreq_driver *default_driver;
24682468

24692469
static void intel_pstate_driver_cleanup(void)
24702470
{
@@ -2758,6 +2758,7 @@ static int __init intel_pstate_init(void)
27582758
hwp_active++;
27592759
hwp_mode_bdw = id->driver_data;
27602760
intel_pstate.attr = hwp_cpufreq_attrs;
2761+
default_driver = &intel_pstate;
27612762
goto hwp_cpu_matched;
27622763
}
27632764
} else {
@@ -2775,7 +2776,8 @@ static int __init intel_pstate_init(void)
27752776
return -ENODEV;
27762777
}
27772778
/* Without HWP start in the passive mode. */
2778-
default_driver = &intel_cpufreq;
2779+
if (!default_driver)
2780+
default_driver = &intel_cpufreq;
27792781

27802782
hwp_cpu_matched:
27812783
/*
@@ -2820,6 +2822,8 @@ static int __init intel_pstate_setup(char *str)
28202822

28212823
if (!strcmp(str, "disable")) {
28222824
no_load = 1;
2825+
} else if (!strcmp(str, "active")) {
2826+
default_driver = &intel_pstate;
28232827
} else if (!strcmp(str, "passive")) {
28242828
default_driver = &intel_cpufreq;
28252829
no_hwp = 1;

0 commit comments

Comments
 (0)