public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@sirena.org.uk>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: runtime PM: common hooks for static and runtime PM
Date: Fri, 5 Feb 2010 16:11:23 +0000	[thread overview]
Message-ID: <20100205161122.GE2600@sirena.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1002051038001.23817-100000@netrider.rowland.org>

On Fri, Feb 05, 2010 at 10:41:40AM -0500, Alan Stern wrote:
> On Fri, 5 Feb 2010, Mark Brown wrote:
> > On Thu, Feb 04, 2010 at 10:24:48AM -0500, Alan Stern wrote:
> > > On Wed, 3 Feb 2010, Kevin Hilman wrote:

> > > > I understand the motivation for this is probably to prevent runtime PM
> > > > transitions during static suspend, and that makes sense.  However, I'm
> > > > wondering if there's some other way to handle my problem without
> > > > having to have the driver have different paths for static and runtime
> > > > PM.

> > > The system PM methods could directly call the runtime_suspend and
> > > runtime_resume methods (which presumably is where you actually disable
> > > or enable the clocks etc.), instead of going indirectly through
> > > pm_runtime_put_sync() and pm_runtime_get_sync().

> > > Or alternatively, both sets of PM methods could call a single pair of
> > > routines to handle the clocks etc.

> > One issue with avoiding the indirection is that they'll need to remember
> > if the device is already suspended in order to avoid doing things like
> > double disabling of clocks or regulators.  Using the runtime PM calls
> > would mean that the core would keep track of that for the driver.

> As you have found out, that approach doesn't work.  You need to figure
> out some way of your own to avoid double disabling.  The PM core can't
> do it for you, because there may be devices that enter _different_
> power states for runtime suspend and system suspend.  For the sake of 
> such devices the core _has_ to do double suspends.

Right, but my point is that one reason for wanting to call into the
runtime PM API during vanilla suspend is that the indirection buys you
the reference counting.

I wonder if it's worth the PM core providing an off the shelf suspend
and resume via runtime PM implementation so drivers only need to assign
function pointers?  As Kevin says this is going to be *very* common for
embedded drivers.

  reply	other threads:[~2010-02-05 16:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03 23:30 runtime PM: common hooks for static and runtime PM Kevin Hilman
2010-02-04 15:24 ` Alan Stern
2010-02-05 10:43   ` Mark Brown
2010-02-05 15:41     ` Alan Stern
2010-02-05 16:11       ` Mark Brown [this message]
2010-02-05 21:40         ` Alan Stern
2010-02-05 22:44           ` Mark Brown
2010-02-06  2:57             ` Alan Stern
2010-02-06 15:46               ` Mark Brown
2010-02-06 16:18                 ` Alan Stern
2010-02-08 14:54                   ` Alan Stern
2010-02-24 18:14                     ` Mark Brown
2010-02-24 18:56                       ` Alan Stern
2010-02-24 22:32                         ` Mark Brown
2010-02-25 15:26                         ` Kevin Hilman
2010-03-16 21:31   ` Kevin Hilman
2010-03-17 14:47     ` Alan Stern
2010-03-17 16:42       ` Kevin Hilman
2010-03-17 17:10         ` Alan Stern
2010-03-17 21:46           ` Rafael J. Wysocki
2010-03-17 22:32             ` Kevin Hilman
2010-03-18 14:13               ` Alan Stern

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=20100205161122.GE2600@sirena.org.uk \
    --to=broonie@sirena.org.uk \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    /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