Skip to content

Commit 1905fac

Browse files
committed
cpufreq/amd-pstate: Update cppc_req_cached for shared mem EPP writes
On EPP only writes update the cached variable so that the min/max performance controls don't need to be updated again. Reviewed-by: Dhananjay Ugwekar <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent 77fbea6 commit 1905fac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ static int shmem_set_epp(struct cpufreq_policy *policy, u8 epp)
336336
{
337337
struct amd_cpudata *cpudata = policy->driver_data;
338338
struct cppc_perf_ctrls perf_ctrls;
339+
u64 value;
339340
int ret;
340341

341342
if (trace_amd_pstate_epp_perf_enabled()) {
@@ -362,6 +363,11 @@ static int shmem_set_epp(struct cpufreq_policy *policy, u8 epp)
362363
}
363364
WRITE_ONCE(cpudata->epp_cached, epp);
364365

366+
value = READ_ONCE(cpudata->cppc_req_cached);
367+
value &= ~AMD_CPPC_EPP_PERF_MASK;
368+
value |= FIELD_PREP(AMD_CPPC_EPP_PERF_MASK, epp);
369+
WRITE_ONCE(cpudata->cppc_req_cached, value);
370+
365371
return ret;
366372
}
367373

0 commit comments

Comments
 (0)