diff mbox series

[V2] cpufreq: amd-pstate-ut: Modify the function to get the highest_perf value

Message ID 20230803014354.3304825-1-li.meng@amd.com (mailing list archive)
State New, archived
Delegated to: viresh kumar
Headers show
Series [V2] cpufreq: amd-pstate-ut: Modify the function to get the highest_perf value | expand

Commit Message

Meng, Li (Jassmine) Aug. 3, 2023, 1:43 a.m. UTC
The previous function amd_get_highest_perf() will be deprecated.
It can only return 166 or 255 by cpuinfo. For platforms that
support preferred core, the value of highest perf can be between
166 and 255. Therefore, it will cause amd-pstate-ut to fail when
run amd_pstate_ut_check_perf().

Signed-off-by: Meng Li <li.meng@amd.com>
---
 drivers/cpufreq/amd-pstate-ut.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Viresh Kumar Aug. 11, 2023, 6:17 a.m. UTC | #1
On 03-08-23, 09:43, Meng Li wrote:
> The previous function amd_get_highest_perf() will be deprecated.
> It can only return 166 or 255 by cpuinfo. For platforms that
> support preferred core, the value of highest perf can be between
> 166 and 255. Therefore, it will cause amd-pstate-ut to fail when
> run amd_pstate_ut_check_perf().
> 
> Signed-off-by: Meng Li <li.meng@amd.com>
> ---
>  drivers/cpufreq/amd-pstate-ut.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied. Thanks.
Rafael J. Wysocki Aug. 11, 2023, 8:52 a.m. UTC | #2
On Fri, Aug 11, 2023 at 8:17 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 03-08-23, 09:43, Meng Li wrote:
> > The previous function amd_get_highest_perf() will be deprecated.
> > It can only return 166 or 255 by cpuinfo. For platforms that
> > support preferred core, the value of highest perf can be between
> > 166 and 255. Therefore, it will cause amd-pstate-ut to fail when
> > run amd_pstate_ut_check_perf().
> >
> > Signed-off-by: Meng Li <li.meng@amd.com>
> > ---
> >  drivers/cpufreq/amd-pstate-ut.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Applied. Thanks.

So may I leave all of the amd-pstate patches to you?

I would gladly do that. :-)
diff mbox series

Patch

diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
index 7f3fe2048981..9c889a4a0177 100644
--- a/drivers/cpufreq/amd-pstate-ut.c
+++ b/drivers/cpufreq/amd-pstate-ut.c
@@ -145,8 +145,6 @@  static void amd_pstate_ut_check_perf(u32 index)
 	struct cpufreq_policy *policy = NULL;
 	struct amd_cpudata *cpudata = NULL;
 
-	highest_perf = amd_get_highest_perf();
-
 	for_each_possible_cpu(cpu) {
 		policy = cpufreq_cpu_get(cpu);
 		if (!policy)
@@ -161,6 +159,7 @@  static void amd_pstate_ut_check_perf(u32 index)
 				return;
 			}
 
+			highest_perf = cppc_perf.highest_perf;
 			nominal_perf = cppc_perf.nominal_perf;
 			lowest_nonlinear_perf = cppc_perf.lowest_nonlinear_perf;
 			lowest_perf = cppc_perf.lowest_perf;
@@ -172,6 +171,7 @@  static void amd_pstate_ut_check_perf(u32 index)
 				return;
 			}
 
+			highest_perf = AMD_CPPC_HIGHEST_PERF(cap1);
 			nominal_perf = AMD_CPPC_NOMINAL_PERF(cap1);
 			lowest_nonlinear_perf = AMD_CPPC_LOWNONLIN_PERF(cap1);
 			lowest_perf = AMD_CPPC_LOWEST_PERF(cap1);