Skip to content

Commit 5ac5411

Browse files
committed
cpufreq: intel_pstate: Simplify intel_pstate_cpu_init()
The initial policy value set by intel_pstate_cpu_init() depends on whether or not CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is set, but that is not necessary, because the core will set the policy to "performance" in cpufreq_init_policy() if the default governor is "performance" anyway. Accordingly, change intel_pstate_cpu_init() to always set policy to CPUFREQ_POLICY_POWERSAVE initially to provide a valid fallback value to cpufreq_init_policy() in case the default cpufreq governor is neither "powersave" nor "performance". Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4d99175 commit 5ac5411

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,10 +2247,11 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
22472247
if (ret)
22482248
return ret;
22492249

2250-
if (IS_ENABLED(CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE))
2251-
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
2252-
else
2253-
policy->policy = CPUFREQ_POLICY_POWERSAVE;
2250+
/*
2251+
* Set the policy to powersave to provide a valid fallback value in case
2252+
* the default cpufreq governor is neither powersave nor performance.
2253+
*/
2254+
policy->policy = CPUFREQ_POLICY_POWERSAVE;
22542255

22552256
return 0;
22562257
}

0 commit comments

Comments
 (0)