All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
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>,
	Axel Haslam <ahaslam@baylibre.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	Andy Gross <andy.gross@linaro.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH 1/2] PM / Domains: Remove redundant pm_runtime_get|put*() in pm_genpd_prepare()
Date: Fri, 22 Apr 2016 11:43:10 -0700	[thread overview]
Message-ID: <7h37qdxz5t.fsf@baylibre.com> (raw)
In-Reply-To: <1461312955-8547-2-git-send-email-ulf.hansson@linaro.org> (Ulf Hansson's message of "Fri, 22 Apr 2016 10:15:54 +0200")

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

> The PM core increases the runtime PM usage count in the system PM prepare
> phase.

nit: increases/decreases ... prepare/complete

> This makes some of the pm_runtime_get|put*() calls in
> pm_gendp_prepare() redundant, so let's remove them.

s/gendp/genpd/

And also add pm_genpd_complete()

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Otherwise...

Reviewed-by: Kevin Hilman <khilman@baylibre.com>

> ---
>  drivers/base/power/domain.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 4ce4ce0..60a3573 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -730,14 +730,11 @@ static int pm_genpd_prepare(struct device *dev)
>  	 * at this point and a system wakeup event should be reported if it's
>  	 * set up to wake up the system from sleep states.
>  	 */
> -	pm_runtime_get_noresume(dev);
>  	if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
>  		pm_wakeup_event(dev, 0);
>  
> -	if (pm_wakeup_pending()) {
> -		pm_runtime_put(dev);
> +	if (pm_wakeup_pending())
>  		return -EBUSY;
> -	}
>  
>  	if (resume_needed(dev, genpd))
>  		pm_runtime_resume(dev);
> @@ -751,10 +748,8 @@ static int pm_genpd_prepare(struct device *dev)
>  
>  	mutex_unlock(&genpd->lock);
>  
> -	if (genpd->suspend_power_off) {
> -		pm_runtime_put_noidle(dev);
> +	if (genpd->suspend_power_off)
>  		return 0;
> -	}
>  
>  	/*
>  	 * The PM domain must be in the GPD_STATE_ACTIVE state at this point,
> @@ -776,7 +771,6 @@ static int pm_genpd_prepare(struct device *dev)
>  		pm_runtime_enable(dev);
>  	}
>  
> -	pm_runtime_put(dev);
>  	return ret;
>  }

  reply	other threads:[~2016-04-22 18:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22  8:15 [PATCH 0/2] PM / Domains: Initial improvements of system PM code in genpd Ulf Hansson
2016-04-22  8:15 ` [PATCH 1/2] PM / Domains: Remove redundant pm_runtime_get|put*() in pm_genpd_prepare() Ulf Hansson
2016-04-22 18:43   ` Kevin Hilman [this message]
2016-04-25  8:21     ` Ulf Hansson
2016-04-25 23:46       ` Rafael J. Wysocki
2016-04-27 18:10       ` Kevin Hilman
2016-04-22  8:15 ` [PATCH 2/2] PM / Domains: Drop unnecessary wakeup code from pm_genpd_prepare() Ulf Hansson

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=7h37qdxz5t.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=ahaslam@baylibre.com \
    --cc=andy.gross@linaro.org \
    --cc=geert+renesas@glider.be \
    --cc=jonathanh@nvidia.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=len.brown@intel.com \
    --cc=lina.iyer@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --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.