Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080AbbGGI3U (ORCPT ); Tue, 7 Jul 2015 04:29:20 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:45884 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752095AbbGGI3P (ORCPT ); Tue, 7 Jul 2015 04:29:15 -0400 X-Greylist: delayed 2126 seconds by postgrey-1.27 at vger.kernel.org; Tue, 07 Jul 2015 04:29:15 EDT Date: Tue, 7 Jul 2015 08:52:20 +0100 From: Javi Merino To: Pi-Cheng Chen Cc: Zhang Rui , Eduardo Valentin , "linaro-kernel@lists.linaro.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" Subject: Re: [PATCH] thermal: cpu_cooling: Iterate over all CPUs in clip_cpu mask to get frequency table Message-ID: <20150707075220.GA2817@e104805> References: <1435723647-3354-1-git-send-email-pi-cheng.chen@linaro.org> <1435723994-3882-1-git-send-email-pi-cheng.chen@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1435723994-3882-1-git-send-email-pi-cheng.chen@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1746 Lines: 53 On Wed, Jul 01, 2015 at 05:13:14AM +0100, Pi-Cheng Chen wrote: > Sorry for the mistake I made when cherry-picking the patch. Fix and resend > again. > > __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 Looks good to me. FWIW, Acked-by: Javi Merino > --- > drivers/thermal/cpu_cooling.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c > index 6509c61..5e90eb6 100644 > --- a/drivers/thermal/cpu_cooling.c > +++ b/drivers/thermal/cpu_cooling.c > @@ -776,9 +776,14 @@ __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) { > pr_debug("%s: CPUFreq table not found\n", __func__); > return ERR_PTR(-EPROBE_DEFER); > -- > 1.9.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/