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: 5403321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4ED19BEEA8 for ; Fri, 28 Nov 2014 13:18:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42B56201B4 for ; Fri, 28 Nov 2014 13:18:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4784C20149 for ; Fri, 28 Nov 2014 13:18:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XuLO4-0005bE-UT; Fri, 28 Nov 2014 13:15:04 +0000 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XuLO1-0005Kq-5m for linux-arm-kernel@lists.infradead.org; Fri, 28 Nov 2014 13:15:02 +0000 Received: by mail-qg0-f44.google.com with SMTP id z60so4744642qgd.31 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 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 In-Reply-To: <20141128111824.533c4641@jawa> User-Agent: Mutt/1.5.22 (2013-10-16) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141128_051501_320236_41DA8E22 X-CRM114-Status: GOOD ( 20.86 ) X-Spam-Score: -0.8 (/) Cc: "devicetree@vger.kernel.org" , Lukasz Majewski , Kukjin Kim , Linux PM , Viresh Kumar , LKML , Rob Herring , linux-samsung-soc , Grant Likely , Zhang Rui , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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++;