public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Chen Yu <yu.c.chen@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH][RFC] cpufreq: Avoid warning during resume by return EAGAIN if cpufreq is unavailable
Date: Tue, 28 Jun 2016 03:31:11 +0200	[thread overview]
Message-ID: <91695540.4NGfil38DW@vostro.rjw.lan> (raw)
In-Reply-To: <20160627072027.GC3341@vireshk-i7>

On Monday, June 27, 2016 12:50:27 PM Viresh Kumar wrote:
> On 27-06-16, 03:12, Rafael J. Wysocki wrote:
> > ---
> >  drivers/cpufreq/cpufreq.c |    7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > Index: linux-pm/drivers/cpufreq/cpufreq.c
> > ===================================================================
> > --- linux-pm.orig/drivers/cpufreq/cpufreq.c
> > +++ linux-pm/drivers/cpufreq/cpufreq.c
> > @@ -1544,9 +1544,6 @@ static unsigned int cpufreq_update_curre
> >  {
> >  	unsigned int new_freq;
> >  
> > -	if (cpufreq_suspended)
> > -		return 0;
> > -
> >  	new_freq = cpufreq_driver->get(policy->cpu);
> >  	if (!new_freq)
> >  		return 0;
> > @@ -2280,6 +2277,10 @@ int cpufreq_update_policy(unsigned int c
> >  	 * -> ask driver for current freq and notify governors about a change
> >  	 */
> >  	if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
> > +		if (cpufreq_suspended) {
> > +			ret = -EAGAIN;
> > +			goto unlock;
> > +		}
> >  		new_policy.cur = cpufreq_update_current_freq(policy);
> >  		if (WARN_ON(!new_policy.cur)) {
> >  			ret = -EIO;
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks, but this needs to go in in two pieces, because cpufreq_start_governor()
in the mainline doesn't check cpufreq_suspended (the linux-next version of it
does that).

So the second part of the patch is needed in the mainline/stable to get rid
of false-positive WARN_ON()s and the first one can go in on top of the
previous linux-next changes.

Thanks,
Rafael


      reply	other threads:[~2016-06-28  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-25 16:28 [PATCH][RFC] cpufreq: Avoid warning during resume by return EAGAIN if cpufreq is unavailable Chen Yu
2016-06-27  1:12 ` Rafael J. Wysocki
2016-06-27  7:20   ` Viresh Kumar
2016-06-28  1:31     ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91695540.4NGfil38DW@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=yu.c.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox