Linux Samsung SOC development
 help / color / mirror / Atom feed
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: Wed, 27 Nov 2013 02:42:27 +0100	[thread overview]
Message-ID: <4787675.sJF8mqYyxv@vostro.rjw.lan> (raw)
In-Reply-To: <4253729.doK7ubnxKx@vostro.rjw.lan>

On Tuesday, November 26, 2013 09:23:15 PM Rafael J. Wysocki wrote:
> 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?

Anyway, if you did what I asked you to do and put the cpufreq suspend/resume
into dpm_suspend/resume_noirq(), I'd probably take this for 3.13.  However,
since you've decided to put those things somewhere else thus making the
change much more intrusive, I can only queue it up for 3.14.

This means I'm going to take the Tianyu's patch as a stop gap for 3.13.

Thanks!

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

  reply	other threads:[~2013-11-27  1:42 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
     [not found]       ` <CAKohpok0E=m=63KXM22usiW7Rsu59cD7Q=+k3tRcW=8269tZnQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-26 20:23         ` Rafael J. Wysocki
2013-11-27  1:42           ` Rafael J. Wysocki [this message]
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
     [not found]   ` <55cc3fbf9c553d669629e8ba98eef2b0ef33aaad.1385374822.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-11-26  4:12     ` viresh kumar
     [not found] ` <cover.1385374819.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
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=4787675.sJF8mqYyxv@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