All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@kernel.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org, Len Brown <len.brown@intel.com>,
	Pavel Machek <pavel@ucw.cz>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Lina Iyer <lina.iyer@linaro.org>,
	Cao Minh Hiep <cm-hiep@jinso.co.jp>,
	Harunaga <nx-truong@jinso.co.jp>
Subject: Re: [PATCH] PM / Domains: Allow runtime PM callbacks to be re-used during system PM
Date: Tue, 17 Nov 2015 13:32:38 -0800	[thread overview]
Message-ID: <7h4mgk1fd5.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1447778561-9767-1-git-send-email-ulf.hansson@linaro.org> (Ulf Hansson's message of "Tue, 17 Nov 2015 17:42:41 +0100")

Ulf Hansson <ulf.hansson@linaro.org> writes:

> Runtime PM centric subsystems/drivers may re-use their runtime PM
> callbacks for system PM. Typically that's done via using the runtime PM
> helpers, pm_runtime_force_suspend|resume().
>
> To genpd, this means its runtime PM callbacks may be invoked even when
> runtime PM has been disabled for the device. By checking this condition,
> it allows genpd to skip latency validation and measurement in the system
> PM path. That's needed to enable drivers/subsystems to re-use the runtime
> PM callbacks for system PM.
>
> Fixes: ba2bbfbf6307 ("PM / Domains: Remove intermediate states from the
> power off sequence")
> Reported-by: Cao Minh Hiep <cm-hiep@jinso.co.jp>
> Reported-by: Harunaga <nx-truong@jinso.co.jp>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>
> This patch has only been quick tested on ux500, so further tests are
> welcome and needed. It was reported [1] to point out a certain commit
> causing the regression, but further analyze actually tells that the
> problem been there longer.
>
> So, I decided to point the fixes tag to a commit from where it actually
> becomes quite simple to address the problem. Earlier than that, is just
> not worth the effort.
>
> [1]
> https://lkml.org/lkml/2015/11/16/748
>
> ---
>  drivers/base/power/domain.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index e03b1ad..8f0c2a3 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -390,6 +390,7 @@ static int pm_genpd_runtime_suspend(struct device *dev)
>  	struct generic_pm_domain *genpd;
>  	bool (*stop_ok)(struct device *__dev);
>  	struct gpd_timing_data *td = &dev_gpd_data(dev)->td;
> +	bool system_pm = !pm_runtime_enabled(dev);

nit: I think this 'system_pm' variable name is confusing, especaly
because it just means runtime PM *not* enabled.

Is !pm_runtime_enabled() really sufficient to determine if these are
being called in the context of system PM?

Kevin

  reply	other threads:[~2015-11-17 21:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 16:42 [PATCH] PM / Domains: Allow runtime PM callbacks to be re-used during system PM Ulf Hansson
2015-11-17 21:32 ` Kevin Hilman [this message]
2015-11-18 12:28   ` Ulf Hansson
2015-11-18 18:11     ` Kevin Hilman
2015-11-20  5:17 ` Cao Minh Hiep

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=7h4mgk1fd5.fsf@deeprootsystems.com \
    --to=khilman@kernel.org \
    --cc=cm-hiep@jinso.co.jp \
    --cc=geert+renesas@glider.be \
    --cc=len.brown@intel.com \
    --cc=lina.iyer@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nx-truong@jinso.co.jp \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.