linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Kevin Hilman <khilman@kernel.org>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended
Date: Thu, 3 Mar 2016 23:54:05 +0300	[thread overview]
Message-ID: <56D8A46D.3030906@cogentembedded.com> (raw)
In-Reply-To: <1457036214-26136-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hello.

On 03/03/2016 11:16 PM, Laurent Pinchart wrote:

    Noticed a few typos as well, some alreayd reported...

> The pm_runtime_force_suspend() and pm_runtime_force_resume() helpers are
> designed to help driver being RPM-centric by offering an easy way to
> manager runtime PM state during system suspend and resume. The first

    Manage.

> function will force the device into runtime suspend at system suspend
> time, while the second one will perform the reverse operation at system
> resume time.
>
> However, the pm_runtime_force_resume() really forces resume, regarding

    Regardless.

> of whether the device was running or already suspended before the call
> to pm_runtime_force_suspend(). This results in devices being runtime
> resumed at system resume time when they shouldn't.
>
> Fix this by recording whether the device has been forcefully suspended
> in pm_runtime_force_suspend() and condition resume in
> pm_runtime_force_resume() to that state.
>
> All current users of pm_runtime_force_resume() call the function
> uncontionally in their system resume handler (some actually set it as

    Unconditionally.

> the resume handler), all after calling pm_runtime_force_suspend() at
> system suspend time. The change in behaviour should thus be safe.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>   drivers/base/power/runtime.c | 12 +++++++++---
>   include/linux/pm.h           |  1 +
>   2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> index 4c7055009bd6..ad2189294c9b 100644
> --- a/drivers/base/power/runtime.c
> +++ b/drivers/base/power/runtime.c
[...]
> @@ -1483,13 +1485,13 @@ err:
>   EXPORT_SYMBOL_GPL(pm_runtime_force_suspend);
>
>   /**
> - * pm_runtime_force_resume - Force a device into resume state.
> + * pm_runtime_force_resume - Force a device into resume state if needed.
>    * @dev: Device to resume.
>    *
>    * Prior invoking this function we expect the user to have brought the device
>    * into low power state by a call to pm_runtime_force_suspend(). Here we reverse
> - * those actions and brings the device into full power. We update the runtime PM
> - * status and re-enables runtime PM.
> + * those actions and bring the device back to its runtime PM state before forced
> + * suspension. We update the runtime PM status and re-enables runtime PM.

    Re-enable.

[...]

MBR, Sergei

  parent reply	other threads:[~2016-03-03 20:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 20:16 [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Laurent Pinchart
2016-03-03 20:35 ` Kevin Hilman
2016-03-03 20:44   ` Laurent Pinchart
2016-03-03 20:54 ` Sergei Shtylyov [this message]
2016-03-04 10:34 ` Ulf Hansson
2016-03-04 15:24   ` Alan Stern
2016-03-04 21:04     ` Laurent Pinchart
2016-03-06 15:38       ` Laurent Pinchart
2016-03-06 16:59         ` Alan Stern
2016-03-07 10:10         ` Ulf Hansson
2016-04-20 23:30           ` Laurent Pinchart
2016-04-21  9:10             ` Ulf Hansson
2016-04-21 12:41               ` Laurent Pinchart
2016-04-21 13:52                 ` Ulf Hansson
2016-04-21 15:11                   ` Laurent Pinchart

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=56D8A46D.3030906@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=khilman@kernel.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    /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).