Skip to content

Commit b7a4115

Browse files
committed
cpufreq/amd-pstate: Invalidate cppc_req_cached during suspend
During resume it's possible the firmware didn't restore the CPPC request MSR but the kernel thinks the values line up. This leads to incorrect performance after resume from suspend. To fix the issue invalidate the cached value at suspend. During resume use the saved values programmed as cached limits. Reviewed-by: Gautham R. Shenoy <[email protected]> Reviewed-by: Dhananjay Ugwekar <[email protected]> Reported-by: Miroslav Pavleski <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217931 Signed-off-by: Mario Limonciello <[email protected]>
1 parent a1d1d8f commit b7a4115

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ static int amd_pstate_epp_reenable(struct cpufreq_policy *policy)
16051605
max_perf, policy->boost_enabled);
16061606
}
16071607

1608-
return amd_pstate_update_perf(cpudata, 0, 0, max_perf, cpudata->epp_cached, false);
1608+
return amd_pstate_epp_update_limit(policy);
16091609
}
16101610

16111611
static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy)
@@ -1654,6 +1654,9 @@ static int amd_pstate_epp_suspend(struct cpufreq_policy *policy)
16541654
if (cppc_state != AMD_PSTATE_ACTIVE)
16551655
return 0;
16561656

1657+
/* invalidate to ensure it's rewritten during resume */
1658+
cpudata->cppc_req_cached = 0;
1659+
16571660
/* set this flag to avoid setting core offline*/
16581661
cpudata->suspended = true;
16591662

0 commit comments

Comments
 (0)