Skip to content

Commit 9dc1791

Browse files
Ashwin Chaugulerafaeljw
authored andcommitted
cpufreq: CPPC: Initialize and check CPUFreq CPU co-ord type correctly
The CPU policy struct indicates the co-ordination type for all CPUs of a common freq domain. Initialize it correctly using the CPU specific data gathered from CPPC ACPI lib via acpi_get_psd_map(). The PSD object is optional, so the cpu->shared_type can also be 0. So instead of assuming any value other than SW_ANY(0xFD) is unsupported, explictly check if shared_type is SW_ALL and then bail. Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d29d673 commit 9dc1791

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
9898
policy->max = cpu->perf_caps.highest_perf;
9999
policy->cpuinfo.min_freq = policy->min;
100100
policy->cpuinfo.max_freq = policy->max;
101+
policy->shared_type = cpu->shared_type;
101102

102103
if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
103104
cpumask_copy(policy->cpus, cpu->shared_cpu_map);
104-
else {
105+
else if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL) {
105106
/* Support only SW_ANY for now. */
106107
pr_debug("Unsupported CPU co-ord type\n");
107108
return -EFAULT;

0 commit comments

Comments
 (0)