lkml.org 
[lkml]   [2015]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table
Date
__cpufreq_cooling_register() might fail if some CPU other than first one in
clip_cpu mask is present earlier e.g. CPU hotplug. Iterate all CPUs in the mask
to handle this case.

Signed-off-by: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
---
drivers/thermal/cpu_cooling.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 6509c61..d5e4ea8 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -776,7 +776,13 @@ __cpufreq_cooling_register(struct device_node *np,
char dev_name[THERMAL_NAME_LENGTH];
struct cpufreq_frequency_table *pos, *table;
unsigned int freq, i, num_cpus;
- int ret;
+ int ret, cpu;
+
+ for_each_cpu(cpu, clip_cpus) {
+ table = cpufreq_frequency_get_table(cpu);
+ if (table)
+ break;
+ }

table = cpufreq_frequency_get_table(cpumask_first(clip_cpus));
if (!table) {
--
1.9.1


\
 
 \ /
  Last update: 2015-07-01 06:21    [W:0.415 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site