mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: viresh kumar <viresh.kumar@linaro.org>
Cc: Nishanth Menon <nm@ti.com>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [RFC PATCH] cpufreq: cpufreq-cpu0: do not allow transitions with regulators suspended
Date: Thu, 14 Nov 2013 23:00:21 +0100	[thread overview]
Message-ID: <2085822.gaTNcUz76n@vostro.rjw.lan> (raw)
In-Reply-To: <52842671.40703@linaro.org>

On Thursday, November 14, 2013 06:55:05 AM viresh kumar wrote:
> On Wednesday 13 November 2013 08:46 PM, Nishanth Menon wrote:
> > arrgh, my bad.. Apologies for the bad one.. I missed it :( Does the following
> > look equivalent?
> 
> yes.
> 
> > With this, I now see:
> 
> > [   43.212714] cpufreq: cpufreq_add_policy_cpu: Failed to stop governor
> > ^^^ ??
> 
> Ahh, I missed this part. I thought it will fail at some other place where there
> is no error checking :), but that's not true.
> 
> Following should fix it for you and looks to be the right way as well.
> 
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index dc67fa0..30b09d3 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1530,6 +1530,14 @@ static void cpufreq_bp_resume(void)
>                 }
>         }
> 
> +       if (has_target()) {
> +               if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
> +                       (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {


I'm not going to apply anything like this.  If I have already, that's been a mistake.

Do not mix assignments with logical operators in such outrageous ways, please.
That's completely unreadable and confusing.

What about:

	ret = __cpufreq_governor(policy, CPUFREQ_GOV_START);
	if (!ret) {
		ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
		if (ret) {


> +                       pr_err("%s: Failed to start governor\n", __func__);
> +                       goto fail;
> +               }
> +       }
> +
>         schedule_work(&policy->update);
> 
>  fail:

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  parent reply	other threads:[~2013-11-14 21:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 18:08 Nishanth Menon
2013-11-12  6:03 ` Viresh Kumar
2013-11-12 15:11   ` Nishanth Menon
2013-11-13  5:49     ` Viresh Kumar
2013-11-13 15:16       ` Nishanth Menon
2013-11-14  1:25         ` viresh kumar
2013-11-14 14:27           ` Nishanth Menon
2013-11-14 16:46             ` viresh kumar
2013-11-14 17:04               ` Nishanth Menon
2013-11-15 10:27                 ` Viresh Kumar
2013-11-15 13:33                   ` Nishanth Menon
2013-11-14 22:00           ` Rafael J. Wysocki [this message]
2013-11-15  4:39             ` viresh kumar

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=2085822.gaTNcUz76n@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=shawn.guo@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /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

all inboxes | Powered by JetHome®