Skip to content

Commit 85d7dda

Browse files
committed
cpufreq/amd-pstate: Fix a regression leading to EPP 0 after hibernate
After resuming from S4, all CPUs except the boot CPU have the wrong EPP hint programmed. This is because when the CPUs were offlined the EPP value was reset to 0. This is a similar problem as fixed by commit ba3319e ("cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume") and the solution is also similar. When offlining rather than reset the values to zero, reset them to match those chosen by the policy. When the CPUs are onlined again these values will be restored. Closes: https://community.frame.work/t/increased-power-usage-after-resuming-from-suspend-on-ryzen-7040-kernel-6-15-regression/74531/20?u=mario_limonciello Fixes: 608a76b ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option") Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
1 parent 3a86608 commit 85d7dda

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,11 @@ static int amd_pstate_cpu_offline(struct cpufreq_policy *policy)
16141614
* min_perf value across kexec reboots. If this CPU is just onlined normally after this, the
16151615
* limits, epp and desired perf will get reset to the cached values in cpudata struct
16161616
*/
1617-
return amd_pstate_update_perf(policy, perf.bios_min_perf, 0U, 0U, 0U, false);
1617+
return amd_pstate_update_perf(policy, perf.bios_min_perf,
1618+
FIELD_GET(AMD_CPPC_DES_PERF_MASK, cpudata->cppc_req_cached),
1619+
FIELD_GET(AMD_CPPC_MAX_PERF_MASK, cpudata->cppc_req_cached),
1620+
FIELD_GET(AMD_CPPC_EPP_PERF_MASK, cpudata->cppc_req_cached),
1621+
false);
16181622
}
16191623

16201624
static int amd_pstate_suspend(struct cpufreq_policy *policy)

0 commit comments

Comments
 (0)