Skip to content

Commit afc9506

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Move max_perf limiting in amd_pstate_update
Move up the max_perf limiting, so that we clamp the des_perf with the updated max_perf. Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com> Link: https://lore.kernel.org/r/20250415082308.3341-1-dhananjay.ugwekar@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 9c32cda commit afc9506

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u8 min_perf,
554554
if (!policy)
555555
return;
556556

557+
/* limit the max perf when core performance boost feature is disabled */
558+
if (!cpudata->boost_supported)
559+
max_perf = min_t(u8, perf.nominal_perf, max_perf);
560+
557561
des_perf = clamp_t(u8, des_perf, min_perf, max_perf);
558562

559563
policy->cur = perf_to_freq(perf, cpudata->nominal_freq, des_perf);
@@ -563,10 +567,6 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u8 min_perf,
563567
des_perf = 0;
564568
}
565569

566-
/* limit the max perf when core performance boost feature is disabled */
567-
if (!cpudata->boost_supported)
568-
max_perf = min_t(u8, perf.nominal_perf, max_perf);
569-
570570
if (trace_amd_pstate_perf_enabled() && amd_pstate_sample(cpudata)) {
571571
trace_amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->freq,
572572
cpudata->cur.mperf, cpudata->cur.aperf, cpudata->cur.tsc,

0 commit comments

Comments
 (0)