Skip to content

Commit ed38eb4

Browse files
committed
cpufreq: intel_pstate: Fix active mode offline/online EPP handling
After commit 4adcf2e ("cpufreq: intel_pstate: Add ->offline and ->online callbacks") the EPP value set by the "performance" scaling algorithm in the active mode is not restored after an offline/online cycle which replaces it with the saved EPP value coming from user space. Address this issue by forcing intel_pstate_hwp_set() to set a new EPP value when it runs first time after online. Fixes: 4adcf2e ("cpufreq: intel_pstate: Add ->offline and ->online callbacks") Link: https://lore.kernel.org/linux-pm/[email protected]/ Reported-by: Srinivas Pandruvada <[email protected]> Cc: 5.9+ <[email protected]> # 5.9+ Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent cd23f02 commit ed38eb4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,12 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu)
10061006
*/
10071007
value &= ~GENMASK_ULL(31, 24);
10081008
value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached);
1009+
/*
1010+
* However, make sure that EPP will be set to "performance" when
1011+
* the CPU is brought back online again and the "performance"
1012+
* scaling algorithm is still in effect.
1013+
*/
1014+
cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN;
10091015
}
10101016

10111017
/*

0 commit comments

Comments
 (0)