Skip to content

Commit 7e86cf1

Browse files
committed
cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume
JIRA: https://issues.redhat.com/browse/RHEL-106954 commit ba3319e Author: Mario Limonciello (AMD) <superm1@kernel.org> Date: Tue Aug 26 00:27:47 2025 -0500 cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume During the suspend sequence the cached CPPC request is destroyed with the expectation that it's restored during resume. This assumption broke when the separate cache EPP variable was removed, and then it was broken again by commit 608a76b ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option") which explicitly set it to zero during suspend. Remove the invalidation and set the value during the suspend call to update limits so that the cached variable can be used to restore on resume. Fixes: 608a76b ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option") Fixes: b7a4115 ("cpufreq/amd-pstate: Invalidate cppc_req_cached during suspend") Reported-by: goldens <goldenspinach.rhbugzilla@gmail.com> Closes: https://community.frame.work/t/increased-power-usage-after-resuming-from-suspend-on-ryzen-7040-kernel-6-15-regression/ Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2391221 Tested-by: goldens <goldenspinach.rhbugzilla@gmail.com> Tested-by: Willian Wang <kernel@willian.wang> Reported-by: Vincent Mauirn <vincent.maurin.fr@gmail.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219981 Tested-by: Alex De Lorenzo <kernel@alexdelorenzo.dev> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Link: https://lore.kernel.org/r/20250826052747.2240670-1-superm1@kernel.org Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent c5132c4 commit 7e86cf1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,13 +1615,14 @@ static int amd_pstate_suspend(struct cpufreq_policy *policy)
16151615
* min_perf value across kexec reboots. If this CPU is just resumed back without kexec,
16161616
* the limits, epp and desired perf will get reset to the cached values in cpudata struct
16171617
*/
1618-
ret = amd_pstate_update_perf(policy, perf.bios_min_perf, 0U, 0U, 0U, false);
1618+
ret = amd_pstate_update_perf(policy, perf.bios_min_perf,
1619+
FIELD_GET(AMD_CPPC_DES_PERF_MASK, cpudata->cppc_req_cached),
1620+
FIELD_GET(AMD_CPPC_MAX_PERF_MASK, cpudata->cppc_req_cached),
1621+
FIELD_GET(AMD_CPPC_EPP_PERF_MASK, cpudata->cppc_req_cached),
1622+
false);
16191623
if (ret)
16201624
return ret;
16211625

1622-
/* invalidate to ensure it's rewritten during resume */
1623-
cpudata->cppc_req_cached = 0;
1624-
16251626
/* set this flag to avoid setting core offline*/
16261627
cpudata->suspended = true;
16271628

0 commit comments

Comments
 (0)