Skip to content

Commit 2aac38a

Browse files
committed
cpufreq/amd-pstate-ut: Run on all of the correct CPUs
If a CPU is missing a policy or one has been offlined then the unit test is skipped for the rest of the CPUs on the system. Instead; iterate online CPUs and skip any missing policies to allow continuing to test the rest of them. Reviewed-by: Gautham R. Shenoy <[email protected]> Reviewed-by: Dhananjay Ugwekar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
1 parent a787534 commit 2aac38a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/cpufreq/amd-pstate-ut.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ static int amd_pstate_ut_check_perf(u32 index)
116116
struct amd_cpudata *cpudata = NULL;
117117
union perf_cached cur_perf;
118118

119-
for_each_possible_cpu(cpu) {
119+
for_each_online_cpu(cpu) {
120120
struct cpufreq_policy *policy __free(put_cpufreq_policy) = NULL;
121121

122122
policy = cpufreq_cpu_get(cpu);
123123
if (!policy)
124-
break;
124+
continue;
125125
cpudata = policy->driver_data;
126126

127127
if (get_shared_mem()) {
@@ -188,12 +188,12 @@ static int amd_pstate_ut_check_freq(u32 index)
188188
int cpu = 0;
189189
struct amd_cpudata *cpudata = NULL;
190190

191-
for_each_possible_cpu(cpu) {
191+
for_each_online_cpu(cpu) {
192192
struct cpufreq_policy *policy __free(put_cpufreq_policy) = NULL;
193193

194194
policy = cpufreq_cpu_get(cpu);
195195
if (!policy)
196-
break;
196+
continue;
197197
cpudata = policy->driver_data;
198198

199199
if (!((policy->cpuinfo.max_freq >= cpudata->nominal_freq) &&

0 commit comments

Comments
 (0)