Skip to content

Commit bf76bb2

Browse files
ionela-voinescurafaeljw
authored andcommitted
cppc_cpufreq: clarify support for coordination types
The previous coordination type handling in the cppc_cpufreq init code created some confusion: the comment mentioned "Support only SW_ANY for now" while only the SW_ALL/ALL case resulted in a failure. The other coordination types (HW_ALL/HW, NONE) were silently supported. Clarify support for coordination types while describing in comments the intended behavior. Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Mian Yousaf Kaukab <ykaukab@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d2641a5 commit bf76bb2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
244244
struct cppc_cpudata *cpu_data = all_cpu_data[policy->cpu];
245245
struct cppc_perf_caps *caps = &cpu_data->perf_caps;
246246
unsigned int cpu = policy->cpu;
247-
int ret = 0;
247+
int i, ret = 0;
248248

249249
cpu_data->cpu = cpu;
250250
ret = cppc_get_perf_caps(cpu, caps);
@@ -281,9 +281,13 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
281281
policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu);
282282
policy->shared_type = cpu_data->shared_type;
283283

284-
if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
285-
int i;
286-
284+
switch (policy->shared_type) {
285+
case CPUFREQ_SHARED_TYPE_HW:
286+
case CPUFREQ_SHARED_TYPE_NONE:
287+
/* Nothing to be done - we'll have a policy for each CPU */
288+
break;
289+
case CPUFREQ_SHARED_TYPE_ANY:
290+
/* All CPUs in the domain will share a policy */
287291
cpumask_copy(policy->cpus, cpu_data->shared_cpu_map);
288292

289293
for_each_cpu(i, policy->cpus) {
@@ -293,9 +297,10 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
293297
memcpy(&all_cpu_data[i]->perf_caps, caps,
294298
sizeof(cpu_data->perf_caps));
295299
}
296-
} else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) {
297-
/* Support only SW_ANY for now. */
298-
pr_debug("Unsupported CPU co-ord type\n");
300+
break;
301+
default:
302+
pr_debug("Unsupported CPU co-ord type: %d\n",
303+
policy->shared_type);
299304
return -EFAULT;
300305
}
301306

0 commit comments

Comments
 (0)