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 22:44:22 +0000 [thread overview]
Message-ID: <20100205224421.GA5466@sirena.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1002051630340.784-100000@netrider.rowland.org>
On Fri, Feb 05, 2010 at 04:40:11PM -0500, Alan Stern wrote:
> On Fri, 5 Feb 2010, Mark Brown wrote:
> > 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.
> What's so hard about doing this?
>
> int my_suspend(struct device *dev)
> {
> if (dev->power.runtime_status == RPM_SUSPENDED)
> return 0;
> return my_runtime_suspend(dev);
> }
> Or if you prefer, stick the "if" statement at the beginning of your
> suspend method and then set both function pointers to the same method.
It's not that it's hard per se, it's that it feels like it's peering
inside the implementation of the API. Having the PM core provide
something would make it clear that this is the expected approach and
ensure that there aren't any silly mistakes, in much the same way that
having SIMPLE_DEV_PM_OPS makes the handling of drivers that use the same
suspend path for both suspend to disk and suspend to RAM clear.
next prev parent reply other threads:[~2010-02-05 22:44 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
2010-02-05 21:40 ` Alan Stern
2010-02-05 22:44 ` Mark Brown [this message]
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=20100205224421.GA5466@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