Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575362

Re: [PATCH 2/3] thermal: cpu_cooling: Check OPP for errors

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] thermal: cpu_cooling: Check OPP for errors
Date Tue, 07 Feb 2017 05:00:01 +0100
Message-ID <t856F-5QF-1@gated-at.bofh.it> (permalink)
References <t7OIx-3Ht-7@gated-at.bofh.it> <t7OIy-3Ht-27@gated-at.bofh.it> <t7Qhk-4M3-7@gated-at.bofh.it>
X-Original-To "Rafael J. Wysocki" <rjw@rjwysocki.net>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+deUxWOTJNzzzXY8UKjMNSgGExOoDeKtxRMZOqt6Cw4=; b=UCg++cSgedOEADRaUIRGR+81vmeuYmMAhl9qKtngka1Jj4Uc04RBlGQ/UmDhlsMRfL dBdbzSzDfJLm4joBBmqQUShItwlWRwD9/4XXcA4b7X1o7aq02ibgsC/tS7KmCb0xpmHH JSLLoP00OAI4zqpz2TB8a9zpAi42A2ApvFaM8=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+deUxWOTJNzzzXY8UKjMNSgGExOoDeKtxRMZOqt6Cw4=; b=fxkultOTcxA/Gz+z6l/FyIhfilRalTZZ17cbyfbpWSJzlhw2Okvs/h9czaeeUzUhW1 VZ0VqfOl1+yWZqR+XGR/IM0nl9qw2OaEm7Z+vivToerBWqFCQ0QSz3YJTweOmOZugF1T j7AKmKMJI+xf8X0jsjj8/9LxTq7NRDn72PVs4gV34dVlOj1VdmIVx+dnDuM+jzsse8uH Lgyol9+haCv/E5QPWxMqRJ8a4vTKk7A1EaGGW4AXc0Cs0kh2W6q7CtmRCnWSp00/p9L8 uyGb7L9g23Km/gzSsyADs8lNfY/IWzgnzBBNap8rVus3+2VO0Zwi7719A7lfou8DFdAG eoQw==
X-Gm-Message-State AIkVDXLmypvaiNcdNcy7lTxJhBCAhfkqB4/BcCs4aBAu9YwVQ8KLyQTUrQmMQP6EKeI5dfLX
X-Received by 10.99.215.5 with SMTP id d5mr18023085pgg.51.1486439898468; Mon, 06 Feb 2017 19:58:18 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc Amit Daniel Kachhap <amit.kachhap@gmail.com>, Javi Merino <javi.merino@kernel.org>, Zhang Rui <rui.zhang@intel.com>, Eduardo Valentin <edubezval@gmail.com>, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot <vincent.guittot@linaro.org>, Dan Carpenter <dan.carpenter@oracle.com>
X-Original-Date Tue, 7 Feb 2017 09:28:15 +0530
X-Original-Message-ID <20170207035815.GK3131@vireshk-i7>
X-Original-References <232171cd9d89c2179e10e1f2aed71ad7fc1f7872.1486376756.git.viresh.kumar@linaro.org> <de7260e97192c3fb57709340cf3766366e38ae76.1486376756.git.viresh.kumar@linaro.org> <2237771.GAr8QlFsVi@aspire.rjw.lan>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1575362

Show key headers only | View raw


On 06-02-17, 13:02, Rafael J. Wysocki wrote:
> On Monday, February 06, 2017 03:56:28 PM Viresh Kumar wrote:
> > It is possible for dev_pm_opp_find_freq_exact() to return errors. It was
> > all fine earlier as dev_pm_opp_get_voltage() had a check within it to
> > check for invalid OPPs, but dev_pm_opp_put() doesn't have any similar
> > checks and the callers need to make sure OPP is valid before calling
> > them.
> > 
> > Also update the later dev_warn_ratelimited() to not print the error
> > message as the OPP is guaranteed to be valid now.
> > 
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> >  drivers/thermal/cpu_cooling.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> > index 85fdbf762fa0..9534540434e2 100644
> > --- a/drivers/thermal/cpu_cooling.c
> > +++ b/drivers/thermal/cpu_cooling.c
> > @@ -431,13 +431,20 @@ static int get_static_power(struct cpufreq_cooling_device *cpufreq_device,
> >  
> >  	opp = dev_pm_opp_find_freq_exact(cpufreq_device->cpu_dev, freq_hz,
> >  					 true);
> > +	if (IS_ERR(opp)) {
> > +		dev_warn_ratelimited(cpufreq_device->cpu_dev,
> > +				     "Failed to find OPP for frequency %lu: %ld\n",
> > +				     freq_hz, PTR_ERR(opp));
> 
> I'm quite unconvinced about the WARN level of these messages.
> 
> They seem to be mostly useful for the people who provide device trees for
> platforms (ie. system integrators).  If users see them, there is not much
> they can do to fix the problem by themselves and the hardware is OK,
> actually.

Sure. I just wanted to keep it consistent within the function.

-- 
viresh

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] thermal: devfreq: Simplify expression Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-06 11:30 +0100
  [PATCH 2/3] thermal: cpu_cooling: Check OPP for errors Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-06 11:30 +0100
    Re: [PATCH 2/3] thermal: cpu_cooling: Check OPP for errors "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-02-06 13:10 +0100
      Re: [PATCH 2/3] thermal: cpu_cooling: Check OPP for errors Viresh Kumar <viresh.kumar@linaro.org> - 2017-02-07 05:00 +0100

csiph-web