aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <[email protected]>2021-11-17 14:57:31 +0100
committerRafael J. Wysocki <[email protected]>2021-11-23 14:02:11 +0100
commited38eb49d101e829ae0f8c0a0d3bf5cb6bcbc6b2 (patch)
treed8f66c6700c50fbd267b1c1708c95a398771e372
parentcd23f02f166892603eb9f2d488152b975872b682 (diff)
cpufreq: intel_pstate: Fix active mode offline/online EPP handling
After commit 4adcf2e5829f ("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: 4adcf2e5829f ("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]>
-rw-r--r--drivers/cpufreq/intel_pstate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1088ff350159..1bc00645b656 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1006,6 +1006,12 @@ static void intel_pstate_hwp_offline(struct cpudata *cpu)
*/
value &= ~GENMASK_ULL(31, 24);
value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached);
+ /*
+ * However, make sure that EPP will be set to "performance" when
+ * the CPU is brought back online again and the "performance"
+ * scaling algorithm is still in effect.
+ */
+ cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN;
}
/*