From patchwork Fri Nov 28 13:14:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 5403311 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D12389F443 for ; Fri, 28 Nov 2014 13:14:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26C02201BB for ; Fri, 28 Nov 2014 13:14:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FC3F201C0 for ; Fri, 28 Nov 2014 13:14:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751212AbaK1NOk (ORCPT ); Fri, 28 Nov 2014 08:14:40 -0500 Received: from mail-qa0-f49.google.com ([209.85.216.49]:52933 "EHLO mail-qa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbaK1NOj (ORCPT ); Fri, 28 Nov 2014 08:14:39 -0500 Received: by mail-qa0-f49.google.com with SMTP id s7so4401002qap.22 for ; Fri, 28 Nov 2014 05:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=jsrShXF5zN4+dIMpQFetudkiHtf57oVSqtOS+pq9wsQ=; b=mB7AmnfMEE88OraynZjnB/MBIPhDXOD4+BoWcb21y8L4J03mxMsx0ozBJyQJNbREHG hztJ9tPUboyiTTxW1ldR8rfs+vl9idls7Q1137Zk59u0Wvob8Qp2yj8NZVsspHj37Q+4 AZnQ5QaAWUtrK/v2eLI+MP8ZljIj2AHfFOxxfOcfrnlapO+JfbwKLP8Iosc81WDjGaVb ZnfRYwLf6384DZTzTH25gSg0q+tSC8cNosFJRgfN34tT6363brkvQs1ZyGbgTYgFEwhf hmfTN4uSbaBzKfuNhaG/+/1xC4wdbeSKK+jWmNfB8iKAxlep3YN4RM7Lt3nrwHIhkiZ5 7LAA== X-Received: by 10.140.43.6 with SMTP id d6mr60816547qga.104.1417180478275; Fri, 28 Nov 2014 05:14:38 -0800 (PST) Received: from developer ([201.75.27.229]) by mx.google.com with ESMTPSA id g4sm9178932qas.22.2014.11.28.05.14.32 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 28 Nov 2014 05:14:36 -0800 (PST) Date: Fri, 28 Nov 2014 09:14:27 -0400 From: Eduardo Valentin To: Lukasz Majewski Cc: Viresh Kumar , Linux PM , Lukasz Majewski , LKML , "devicetree@vger.kernel.org" , Grant Likely , Kukjin Kim , "linux-arm-kernel@lists.infradead.org" , linux-samsung-soc , Zhang Rui , Rob Herring Subject: Re: [PATCHv2 1/1] thermal: cpu_cooling: check for the readiness of cpufreq layer Message-ID: <20141128131425.GA23622@developer> References: <1417097577-3548-1-git-send-email-edubezval@gmail.com> <20141128111824.533c4641@jawa> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141128111824.533c4641@jawa> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Folks, On Fri, Nov 28, 2014 at 11:18:24AM +0100, Lukasz Majewski wrote: > On Fri, 28 Nov 2014 13:35:49 +0530 > Viresh Kumar wrote: > > > On 27 November 2014 at 19:42, Eduardo Valentin > > wrote: > > > (I'm sorry VireshK, I am still using my normal practice) :-) > > > > That's fine :) > > > > > diff --git a/drivers/thermal/cpu_cooling.c > > > b/drivers/thermal/cpu_cooling.c index 1ab0018..bed3fa2 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_frequency_get_table(0)) { > > > + pr_err("cpu_cooling: cpufreq layer not ready! > > > Deferring.\n"); > > > > Throwing an error here doesn't look to be the right thing. Ultimately > > we will register the cooling dev when probed again after some time. > > > > So, a pr_debug() suits more here. > > Yeah, I agree here. > > Also, this breaks existing exynos thermal drivers as they don't handle > > -EPROBE_DEFER well right now. > > Unfortunately Viresh is correct here. Current (before rework) Exynos > TMU driver expects that cpu_cooling device will succeed. > Well, I wouldn't say unfortunately, but fortunately! :-) Ok. But I believe it is a matter of propagating the error code. As I included in this patch: > > > > I reached here, because one of my patches had something similar to > > what you wrote. Just for this file though, haven't updated any other > > drivers though. > > > > Will be sending you my small patchset by end of day today, please see > > if they make any sense at all.. The version you sent (for exynos) is better because there is a check for not print error messages in case of deferring. However, I would prefer, at least to what comes to deferring, to update the drivers altogether with the inclusion of the check in cpu cooling. This way the change in behavior is atomic, in terms of commit changes. Viresh, if you don't mind, I will merge your patch 04/26 into this one. > > Best regards, > ?ukasz Majewski BR, Eduardo Valentin diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index 3f5ad25..f84975e 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -373,7 +373,7 @@ int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf) if (IS_ERR(th_zone->cool_dev[th_zone->cool_dev_size])) { dev_err(sensor_conf->dev, "Failed to register cpufreq cooling device\n"); - ret = -EINVAL; + ret = PTR_ERR(th_zone->cool_dev[th_zone->cool_dev_size]); goto err_unregister; } th_zone->cool_dev_size++;