mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
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 commit608a76b652("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:608a76b652("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option") Fixes:b7a4115658("cpufreq/amd-pstate: Invalidate cppc_req_cached during suspend") Reported-by: goldens <[email protected]> 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 <[email protected]> Tested-by: Willian Wang <[email protected]> Reported-by: Vincent Mauirn <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219981 Tested-by: Alex De Lorenzo <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello (AMD) <[email protected]>
This commit is contained in:
1 parent
220abf77e7
commit
ba3319e590
1 file changed
+5
-4
@@ -1628,13 +1628,14 @@ static int amd_pstate_suspend(struct cpufreq_policy *policy)
|
||||
* min_perf value across kexec reboots. If this CPU is just resumed back without kexec,
|
||||
* the limits, epp and desired perf will get reset to the cached values in cpudata struct
|
||||
*/
|
||||
ret = amd_pstate_update_perf(policy, perf.bios_min_perf, 0U, 0U, 0U, false);
|
||||
ret = amd_pstate_update_perf(policy, perf.bios_min_perf,
|
||||
FIELD_GET(AMD_CPPC_DES_PERF_MASK, cpudata->cppc_req_cached),
|
||||
FIELD_GET(AMD_CPPC_MAX_PERF_MASK, cpudata->cppc_req_cached),
|
||||
FIELD_GET(AMD_CPPC_EPP_PERF_MASK, cpudata->cppc_req_cached),
|
||||
false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* invalidate to ensure it's rewritten during resume */
|
||||
cpudata->cppc_req_cached = 0;
|
||||
|
||||
/* set this flag to avoid setting core offline*/
|
||||
cpudata->suspended = true;
|
||||
|
||||
|
||||
Reference in new issue
Block a user