From: Nishanth Menon <nm@ti.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
"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: Wed, 13 Nov 2013 09:16:46 -0600 [thread overview]
Message-ID: <20131113151645.GA17828@kahuna> (raw)
In-Reply-To: <CAKohpomB=wnct88wrTvW-qixLQPQGjVrCVF3V-BSbY7mhsSYQg@mail.gmail.com>
On 11:19-20131113, Viresh Kumar wrote:
> On 12 November 2013 20:41, Nishanth Menon <nm@ti.com> wrote:
> > On 11/12/2013 12:03 AM, Viresh Kumar wrote:
[...]
> >> Can you try attached patch? I will then repost it formally...
> >
> > I tried a equivalent of this for v3.12 tag:
[..]
> > @@ -1252,7 +1252,7 @@ static int __cpufreq_remove_dev_finish(struct
> > device *dev,
> >
> > /* If cpu is last user of policy, free policy */
> > if (cpus == 1) {
> > - if (cpufreq_driver->target) {
> > + if (cpufreq_driver->target && !frozen) {
> > ret = __cpufreq_governor(policy,
> > CPUFREQ_GOV_POLICY_EXIT);
>
> This is not an equivalent of my patch :)
arrgh, my bad.. Apologies for the bad one.. I missed it :( Does the following
look equivalent?
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 04548f7..a9847ce 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1186,7 +1186,7 @@ static int __cpufreq_remove_dev_prepare(struct device *dev,
return -EINVAL;
}
- if (cpufreq_driver->target) {
+ if (cpufreq_driver->target && (!frozen || policy->governor_enabled)) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
if (ret) {
pr_err("%s: Failed to stop governor\n", __func__);
@@ -1295,7 +1295,7 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
if (!frozen)
cpufreq_policy_free(policy);
} else {
- if (cpufreq_driver->target) {
+ if (cpufreq_driver->target && !frozen) {
if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
(ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
pr_err("%s: Failed to start governor\n",
With this, I now see:
wakeup from "mem" at Sat Jan 1 00:17:45 2000
[ 40.823352] PM: Syncing filesystems ... done.
[ 40.848058] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 40.857869] Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
[ 40.884567] smsc95xx 1-3:1.0 eth0: entering SUSPEND2 mode
[ 40.955323] PM: suspend of devices complete after 81.563 msecs
[ 40.967333] PM: late suspend of devices complete after 5.789 msecs
[ 40.981182] PM: noirq suspend of devices complete after 7.274 msecs
[ 40.988005] Disabling non-boot CPUs ...
[ 41.000297] CPU1: shutdown
[ 43.169193] Powerdomain (core_pwrdm) didn't enter target state 1
[ 43.175681] Powerdomain (emu_pwrdm) didn't enter target state 1
[ 43.182097] Powerdomain (l3init_pwrdm) didn't enter target state 1
[ 43.188762] Could not enter target state in pm_suspend
[ 43.194298] A possible cause could be an old bootloader - try u-boot >= v2012.07
[ 43.203291] Enabling non-boot CPUs ...
[ 43.210398] CPU1: Booted secondary processor
[ 43.212714] cpufreq: cpufreq_add_policy_cpu: Failed to stop governor
^^^ ??
[ 43.224252] CPU1 is up
[ 43.248114] PM: noirq resume of devices complete after 21.329 msecs
[ 43.260582] PM: early resume of devices complete after 4.201 msecs
[ 43.623307] ata1: SATA link down (SStatus 0 SControl 300)
[ 44.006234] PM: resume of devices complete after 742.501 msecs
[ 44.020163] Restarting tasks ... done.
but, yes, the patch does squelch the warning I saw.
--
Regards,
Nishanth Menon
next prev parent reply other threads:[~2013-11-13 15:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 18:08 [RFC PATCH] cpufreq: cpufreq-cpu0: do not allow transitions with regulators suspended 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 [this message]
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
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=20131113151645.GA17828@kahuna \
--to=nm@ti.com \
--cc=cpufreq@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--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;
as well as URLs for NNTP newsgroup(s).