Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914AbaK0EIm (ORCPT ); Wed, 26 Nov 2014 23:08:42 -0500 Received: from mail-ob0-f169.google.com ([209.85.214.169]:54347 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753222AbaK0EIk (ORCPT ); Wed, 26 Nov 2014 23:08:40 -0500 MIME-Version: 1.0 In-Reply-To: <1417024212-1775-1-git-send-email-edubezval@gmail.com> References: <1417024212-1775-1-git-send-email-edubezval@gmail.com> Date: Thu, 27 Nov 2014 09:38:39 +0530 Message-ID: Subject: Re: [PATCH 1/1] thermal: cpu_cooling: check for the readiness of cpufreq layer From: Viresh Kumar To: Eduardo Valentin Cc: Linux PM , Lukasz Majewski , LKML , "devicetree@vger.kernel.org" , Grant Likely , Kukjin Kim , "linux-arm-kernel@lists.infradead.org" , linux-samsung-soc , Naveen Krishna Chatradhi , Rob Herring , Zhang Rui Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Few nits.. On 26 November 2014 at 23:20, Eduardo Valentin wrote: > Signed-off-by: Eduardo Valentin > --- The normal practice is to write the non-commitable part here ... > drivers/thermal/cpu_cooling.c | 5 +++++ > drivers/thermal/db8500_cpufreq_cooling.c | 5 ----- > drivers/thermal/imx_thermal.c | 5 ----- > drivers/thermal/samsung/exynos_thermal_common.c | 2 +- > drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 6 ------ > 5 files changed, 6 insertions(+), 17 deletions(-) > --- But this works as well :) > This is attempt to organize the cpu cooling vs. cpufreq boot sequencing. > The main change in this patch, as in the commit log, is to have the check > for the cpufreq layer in the cpu cooling device registration, instead of > in thermal drivers. This way, drivers don't need to bother about it, they > just need to propagate the error value. > > This change was tested on top of: > (0) - Viresh's change in cpufreq layer and cpufreq-dt (up to patch 4): > https://patchwork.kernel.org/patch/5384141/ > https://patchwork.kernel.org/patch/5384151/ > https://patchwork.kernel.org/patch/5384161/ > https://patchwork.kernel.org/patch/5384171/ > (1) - fix of thermal core: > https://patchwork.kernel.org/patch/5326991/ > > After Viresh's changes, cpufreq-dt is properly sequenced with cpu cooling > registration. Non-of based drivers also should take advantage if these > changes, as now they do not need to check for cpufreq layer. The check is > where it belongs, in cpu cooling device registration. > > BR, Eduardo Valentin > > > diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c > index 1ab0018..9e6945b 100644 > --- a/drivers/thermal/cpu_cooling.c > +++ b/drivers/thermal/cpu_cooling.c > @@ -440,6 +440,11 @@ __cpufreq_cooling_register(struct device_node *np, > int ret = 0, i; > struct cpufreq_policy policy; > > + if (!cpufreq_get_current_driver() || !cpufreq_frequency_get_table(0)) { Only !cpufreq_frequency_get_table(0) is enough here. For rest: Acked-by: Viresh Kumar -- 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/