Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349562

Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended

From Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Newsgroups linux.kernel
Subject Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended
Date 2016-03-03 21:50 +0100
Message-ID <r8Im6-440-9@gated-at.bofh.it> (permalink)
References <r8HT4-3NY-17@gated-at.bofh.it> <r8Icq-3Ym-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Kevin,

(CC'ing Ulf)

Thank you for the review.

On Thursday 03 March 2016 12:35:53 Kevin Hilman wrote:
> Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> writes:
> > 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
> 
> s/manager/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
> 
> s/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.
> 
> Agreed.
> 
> > 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
> > 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>
> 
> Reviewed-by: Kevin Hilman <khilman@baylibre.com>
> 
> I agree this is the right approach, but Ulf should ack this too since
> he's looked into all the strange corner case involved and may know of
> something I've missed.

Sure, the more reviewers, the merrier :-)

-- 
Regards,

Laurent Pinchart

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> - 2016-03-03 21:20 +0100
  Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Kevin Hilman <khilman@baylibre.com> - 2016-03-03 21:40 +0100
    Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-03-03 21:50 +0100
  Re: [PATCH] PM / Runtime: Only force-resume device if it has been  force-suspended Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-03-03 22:00 +0100
  Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Ulf Hansson <ulf.hansson@linaro.org> - 2016-03-04 11:40 +0100
    Re: [PATCH] PM / Runtime: Only force-resume device if it has been  force-suspended Alan Stern <stern@rowland.harvard.edu> - 2016-03-04 16:30 +0100
      Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-03-04 22:10 +0100
        Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-03-06 16:40 +0100
          Re: [PATCH] PM / Runtime: Only force-resume device if it has been  force-suspended Alan Stern <stern@rowland.harvard.edu> - 2016-03-06 18:00 +0100
          Re: [PATCH] PM / Runtime: Only force-resume device if it has been force-suspended Ulf Hansson <ulf.hansson@linaro.org> - 2016-03-07 11:20 +0100

csiph-web