]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpufreq/amd-pstate-ut: Allow lowest nonlinear and lowest to be the same
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 14 Feb 2025 18:59:40 +0000 (12:59 -0600)
committerMario Limonciello <mario.limonciello@amd.com>
Thu, 6 Mar 2025 19:01:25 +0000 (13:01 -0600)
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 <gautham.shenoy@amd.com>
Reviewed-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/amd-pstate-ut.c

index e02672e67380ad62e4900caa137a6c410f0f4114..b3693a4c28d26760d75d64bc00de41b6e76f1d96 100644 (file)
@@ -184,7 +184,7 @@ static void amd_pstate_ut_check_perf(u32 index)
 
                if (!((highest_perf >= nominal_perf) &&
                        (nominal_perf > lowest_nonlinear_perf) &&
-                       (lowest_nonlinear_perf > lowest_perf) &&
+                       (lowest_nonlinear_perf >= lowest_perf) &&
                        (lowest_perf > 0))) {
                        amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
                        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)
 
                if (!((policy->cpuinfo.max_freq >= cpudata->nominal_freq) &&
                        (cpudata->nominal_freq > cpudata->lowest_nonlinear_freq) &&
-                       (cpudata->lowest_nonlinear_freq > policy->cpuinfo.min_freq) &&
+                       (cpudata->lowest_nonlinear_freq >= policy->cpuinfo.min_freq) &&
                        (policy->cpuinfo.min_freq > 0))) {
                        amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL;
                        pr_err("%s cpu%d max=%d >= nominal=%d > lowest_nonlinear=%d > min=%d > 0, the formula is incorrect!\n",