[PATCH v2 09/17] cpufreq/amd-pstate-ut: Continue on missing policies

Mario Limonciello posted 17 patches 10 months, 1 week ago
There is a newer version of this series
[PATCH v2 09/17] cpufreq/amd-pstate-ut: Continue on missing policies
Posted by Mario Limonciello 10 months, 1 week ago
From: Mario Limonciello <mario.limonciello@amd.com>

If a CPU is missing a policy then the unit test is skipped for the rest
of the CPUs on the system.

Instead just skip the rest of that test and continue to test the rest
of them.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2:
 * new patch

 drivers/cpufreq/amd-pstate-ut.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
index 028527a0019ca..b888a5877ad93 100644
--- a/drivers/cpufreq/amd-pstate-ut.c
+++ b/drivers/cpufreq/amd-pstate-ut.c
@@ -121,7 +121,7 @@ static int amd_pstate_ut_check_perf(u32 index)
 
 		policy = cpufreq_cpu_get(cpu);
 		if (!policy)
-			break;
+			continue;
 		cpudata = policy->driver_data;
 
 		if (get_shared_mem()) {
@@ -193,7 +193,7 @@ static int amd_pstate_ut_check_freq(u32 index)
 
 		policy = cpufreq_cpu_get(cpu);
 		if (!policy)
-			break;
+			continue;
 		cpudata = policy->driver_data;
 
 		if (!((policy->cpuinfo.max_freq >= cpudata->nominal_freq) &&
-- 
2.43.0
Re: [PATCH v2 09/17] cpufreq/amd-pstate-ut: Continue on missing policies
Posted by Gautham R. Shenoy 10 months ago
On Fri, Feb 14, 2025 at 06:52:36PM -0600, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> If a CPU is missing a policy then the unit test is skipped for the rest
> of the CPUs on the system.
> 
> Instead just skip the rest of that test and continue to test the rest
> of them.

Along with this change, does it make sense to only loop over the
online CPUs instead of possible CPUs ?


-- 
Thanks and Regards
gautham.




> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2:
>  * new patch
> 
>  drivers/cpufreq/amd-pstate-ut.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
> index 028527a0019ca..b888a5877ad93 100644
> --- a/drivers/cpufreq/amd-pstate-ut.c
> +++ b/drivers/cpufreq/amd-pstate-ut.c
> @@ -121,7 +121,7 @@ static int amd_pstate_ut_check_perf(u32 index)
>  
>  		policy = cpufreq_cpu_get(cpu);
>  		if (!policy)
> -			break;
> +			continue;
>  		cpudata = policy->driver_data;
>  
>  		if (get_shared_mem()) {
> @@ -193,7 +193,7 @@ static int amd_pstate_ut_check_freq(u32 index)
>  
>  		policy = cpufreq_cpu_get(cpu);
>  		if (!policy)
> -			break;
> +			continue;
>  		cpudata = policy->driver_data;
>  
>  		if (!((policy->cpuinfo.max_freq >= cpudata->nominal_freq) &&
> -- 
> 2.43.0
>
Re: [PATCH v2 09/17] cpufreq/amd-pstate-ut: Continue on missing policies
Posted by Mario Limonciello 10 months ago
On 2/17/2025 05:38, Gautham R. Shenoy wrote:
> On Fri, Feb 14, 2025 at 06:52:36PM -0600, Mario Limonciello wrote:
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> If a CPU is missing a policy then the unit test is skipped for the rest
>> of the CPUs on the system.
>>
>> Instead just skip the rest of that test and continue to test the rest
>> of them.
> 
> Along with this change, does it make sense to only loop over the
> online CPUs instead of possible CPUs ?
> 
> 

Sure thing.  Will change this patch for v3.

Thanks!