Skip to content

Commit 0e9a863

Browse files
Perry Yuanrafaeljw
authored andcommitted
cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor
The patch will fix the invalid desired perf value for powersave governor. This issue is found when testing on one AMD EPYC system, the actual des_perf is smaller than the min_perf value, that is invalid value. because the min_perf is the lowest_perf system can support in idle state. Reviewed-by: Huang Rui <[email protected]> Signed-off-by: Perry Yuan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b185c50 commit 0e9a863

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf,
269269
u64 prev = READ_ONCE(cpudata->cppc_req_cached);
270270
u64 value = prev;
271271

272+
des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
272273
value &= ~AMD_CPPC_MIN_PERF(~0L);
273274
value |= AMD_CPPC_MIN_PERF(min_perf);
274275

@@ -357,8 +358,6 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
357358
if (max_perf < min_perf)
358359
max_perf = min_perf;
359360

360-
des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf);
361-
362361
amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true);
363362
}
364363

0 commit comments

Comments
 (0)