Skip to content

Commit 66030cc

Browse files
committed
cpufreq/amd-pstate-ut: Allow lowest nonlinear and lowest to be the same
Several Ryzen AI processors support the exact same value for lowest nonlinear perf and lowest perf. Loosen up the unit tests to allow this scenario. Reviewed-by: Gautham R. Shenoy <[email protected]> Reviewed-by: Dhananjay Ugwekar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent 93984d3 commit 66030cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/amd-pstate-ut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void amd_pstate_ut_check_perf(u32 index)
184184

185185
if (!((highest_perf >= nominal_perf) &&
186186
(nominal_perf > lowest_nonlinear_perf) &&
187-
(lowest_nonlinear_perf > lowest_perf) &&
187+
(lowest_nonlinear_perf >= lowest_perf) &&
188188
(lowest_perf > 0))) {
189189
amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
190190
pr_err("%s cpu%d highest=%d >= nominal=%d > lowest_nonlinear=%d > lowest=%d > 0, the formula is incorrect!\n",
@@ -217,7 +217,7 @@ static void amd_pstate_ut_check_freq(u32 index)
217217

218218
if (!((policy->cpuinfo.max_freq >= cpudata->nominal_freq) &&
219219
(cpudata->nominal_freq > cpudata->lowest_nonlinear_freq) &&
220-
(cpudata->lowest_nonlinear_freq > policy->cpuinfo.min_freq) &&
220+
(cpudata->lowest_nonlinear_freq >= policy->cpuinfo.min_freq) &&
221221
(policy->cpuinfo.min_freq > 0))) {
222222
amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
223223
pr_err("%s cpu%d max=%d >= nominal=%d > lowest_nonlinear=%d > min=%d > 0, the formula is incorrect!\n",

0 commit comments

Comments
 (0)