From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
Patch Tracking <patches@linaro.org>,
"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>,
Nishanth Menon <nm@ti.com>,
Stephen Warren <swarren@wwwdotorg.org>,
Kgene Kim <kgene.kim@samsung.com>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
linux-tegra@vger.kernel.org, jinchoi@broadcom.com,
Lan Tianyu <tianyu.lan@intel.com>,
Sebastian Capella <sebastian.capella@linaro.org>,
Jonghwan Choi <jhbird.choi@samsung.com>
Subject: Re: [PATCH V3 1/6] cpufreq: suspend governors on system suspend/hibernate
Date: Tue, 26 Nov 2013 21:23:15 +0100 [thread overview]
Message-ID: <4253729.doK7ubnxKx@vostro.rjw.lan> (raw)
In-Reply-To: <CAKohpok0E=m=63KXM22usiW7Rsu59cD7Q=+k3tRcW=8269tZnQ@mail.gmail.com>
On Tuesday, November 26, 2013 07:56:19 AM Viresh Kumar wrote:
> On 26 November 2013 04:59, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> >> @@ -1259,6 +1262,8 @@ int dpm_suspend(pm_message_t state)
> >>
> >> might_sleep();
> >>
> >> + cpufreq_suspend();
> >> +
> >>
> >> mutex_lock(&dpm_list_mtx);
> >> pm_transition = state;
> >> async_error = 0;
> >
> > Shouldn't it do cpufreq_resume() on errors?
>
> Yes and this is already done I believe. In case dpm_suspend() fails,
> dpm_resume() gets called. Isn't it?
OK
> >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> >> +void cpufreq_suspend(void)
> >> +{
> >> + struct cpufreq_policy *policy;
> >> +
> >> + if (!has_target())
> >> + return;
> >> +
> >> + pr_debug("%s: Suspending Governors\n", __func__);
> >> +
> >> + list_for_each_entry(policy, &cpufreq_policy_list, policy_list)
> >> + if (__cpufreq_governor(policy, CPUFREQ_GOV_STOP))
> >> + pr_err("%s: Failed to stop governor for policy: %p\n",
> >> + __func__, policy);
> >
> > This appears to be racy. Is it really racy, or just seemingly?
>
> Why does it look racy to you? Userspace should be frozen by now,
> policy_list should be stable as well as nobody would touch it.
You're stopping governors while they may be in use in principle. Do we have
suitable synchronization in place for that?
Rafael
next prev parent reply other threads:[~2013-11-26 20:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 14:11 [PATCH V3 0/6] cpufreq: suspend early/resume late Viresh Kumar
2013-11-25 14:11 ` [PATCH V3 1/6] cpufreq: suspend governors on system suspend/hibernate Viresh Kumar
2013-11-25 23:29 ` Rafael J. Wysocki
2013-11-26 2:26 ` Viresh Kumar
2013-11-26 20:23 ` Rafael J. Wysocki [this message]
2013-11-27 1:42 ` Rafael J. Wysocki
2013-11-27 3:07 ` Viresh Kumar
2013-11-27 7:08 ` Lan Tianyu
2013-11-27 7:39 ` Viresh Kumar
2013-11-27 3:13 ` Viresh Kumar
2013-11-26 4:12 ` viresh kumar
2013-11-25 14:11 ` [PATCH V3 2/6] cpufreq: call driver's suspend/resume for each policy Viresh Kumar
2013-11-25 14:11 ` [PATCH V3 3/6] cpufreq: Implement cpufreq_generic_suspend() Viresh Kumar
2013-11-25 14:11 ` [PATCH V3 4/6] cpufreq: exynos: Use cpufreq_generic_suspend() Viresh Kumar
2013-11-25 14:11 ` [PATCH V3 5/6] cpufreq: s5pv210: " Viresh Kumar
2013-11-25 14:11 ` [PATCH V3 6/6] cpufreq: Tegra: " Viresh Kumar
2013-11-25 19:29 ` [PATCH V3 0/6] cpufreq: suspend early/resume late Stephen Warren
2013-11-25 21:37 ` Nishanth Menon
2013-11-26 6:37 ` Lan Tianyu
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=4253729.doK7ubnxKx@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=cpufreq@vger.kernel.org \
--cc=jhbird.choi@samsung.com \
--cc=jinchoi@broadcom.com \
--cc=kgene.kim@samsung.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nm@ti.com \
--cc=patches@linaro.org \
--cc=sebastian.capella@linaro.org \
--cc=swarren@wwwdotorg.org \
--cc=tianyu.lan@intel.com \
--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®