From: Kevin Hilman <khilman@ti.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
linux-omap@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
Paul Walmsley <paul@pwsan.com>
Subject: Re: [linux-pm] calling runtime PM from system PM methods
Date: Wed, 08 Jun 2011 15:50:03 -0700 [thread overview]
Message-ID: <87hb80546c.fsf@ti.com> (raw)
In-Reply-To: <201106072332.30464.rjw@sisk.pl> (Rafael J. Wysocki's message of "Tue, 7 Jun 2011 23:32:30 +0200")
"Rafael J. Wysocki" <rjw@sisk.pl> writes:
[...]
> you need to separate the system suspend handling from runtime PM.
/me risks getting yelled at again and jumps back in ;)
> Each of them requires a different approach, because the goal is really
> different in both cases (basically, runtime PM triggers when the
> device is _known_ to be idle, while system suspend may trigger while
> it's actually being used).
OK, but from the driver's perspective, the goals do not seem all that
different to me:
Runtime suspend
1. activity
2. activity finishes
3. device is _known_ to be idle
4. trigger device low-power transition
system suspend [echo mem > /sys/power/state]
1. activity
2. prevent future activity, halt/wait for current activity
3. device is _known_ to be idle
4. trigger device low-power transition
The only difference is step 2. In runtime suspend, the activity
finishes on its own, in system suspend, the activity is forcibly
stopped. In either case, after that point the device is known to be
idle, and proceeding from there is identical. IOW, based on the above,
another way of looking at system PM is forcing idle so that runtime PM
can happen.
I think it's important to note the similarities as well as the
differences. Maybe I'm still really blind here, but I cannot see how
they can be completely decoupled.
More specifically, what should be the approach in system suspend when a
device is already runtime suspended? If you treat runtime and system PM
as completely independent, you would have to runtime resume the device
so that it can then be immediately system suspended.
For many (if not all) devices though, what I suspect we would want is
for devices that are runtime suspended to stay runtime suspended across
a system suspend *and* resume. That would mean that the device power
domain would not call system PM callbacks on devices that are runtime
suspended.
At least for device power domains where the low-power state is identical
between runtime suspend and system suspend, this makes a lot of sense
(to me.) Device power domain ->suspend might look something like this
(obviously not tested):
if (pm_runtime_suspended(dev))
return;
pm_generic_suspend(dev);
magic_device_idle(dev); /* HW-specific, shared with runtime PM */
priv->flags |= MY_DEVICE_SYS_SUSPENDED;
and ->resume():
if (priv->flags & MY_DEVICE_SYS_SUSPENDED) {
magic_device_enable(dev);
pm_generic_resume(dev);
}
Kevin
next prev parent reply other threads:[~2011-06-08 22:50 UTC|newest]
Thread overview: 117+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 0:05 calling runtime PM from system PM methods Kevin Hilman
2011-06-02 14:18 ` [linux-pm] " Alan Stern
2011-06-02 17:10 ` Kevin Hilman
2011-06-02 18:38 ` Alan Stern
2011-06-02 18:38 ` Alan Stern
2011-06-06 18:29 ` Rafael J. Wysocki
2011-06-06 18:29 ` [linux-pm] " Rafael J. Wysocki
2011-06-06 19:16 ` Alan Stern
2011-06-06 19:16 ` Alan Stern
2011-06-06 22:25 ` [linux-pm] " Kevin Hilman
2011-06-07 13:55 ` Alan Stern
2011-06-07 13:55 ` [linux-pm] " Alan Stern
2011-06-07 21:32 ` Rafael J. Wysocki
2011-06-07 22:34 ` Kevin Hilman
2011-06-07 22:34 ` Kevin Hilman
2011-06-08 22:50 ` Kevin Hilman [this message]
2011-06-09 5:29 ` [linux-pm] " Magnus Damm
2011-06-09 5:29 ` Magnus Damm
2011-06-09 13:56 ` Alan Stern
2011-06-09 13:56 ` [linux-pm] " Alan Stern
2011-06-10 14:36 ` Mark Brown
2011-06-10 14:51 ` Alan Stern
2011-06-10 14:51 ` [linux-pm] " Alan Stern
2011-06-10 15:21 ` Mark Brown
2011-06-10 15:45 ` Alan Stern
2011-06-10 15:57 ` Mark Brown
2011-06-10 17:17 ` Alan Stern
2011-06-10 17:31 ` Mark Brown
2011-06-10 17:31 ` [linux-pm] " Mark Brown
2011-06-10 18:38 ` Rafael J. Wysocki
2011-06-10 18:42 ` Mark Brown
2011-06-10 18:42 ` [linux-pm] " Mark Brown
2011-06-10 20:27 ` Rafael J. Wysocki
2011-06-10 21:27 ` Alan Stern
2011-06-10 21:27 ` [linux-pm] " Alan Stern
2011-06-11 11:42 ` Mark Brown
2011-06-11 11:42 ` [linux-pm] " Mark Brown
2011-06-11 20:56 ` Rafael J. Wysocki
2011-06-13 12:22 ` [linux-pm] " Mark Brown
2011-06-13 12:22 ` Mark Brown
2011-06-10 20:27 ` Rafael J. Wysocki
2011-06-10 18:38 ` Rafael J. Wysocki
2011-06-10 17:17 ` Alan Stern
2011-06-10 15:57 ` Mark Brown
2011-06-10 15:45 ` Alan Stern
2011-06-10 15:21 ` Mark Brown
2011-06-10 18:49 ` Rafael J. Wysocki
2011-06-10 18:49 ` [linux-pm] " Rafael J. Wysocki
2011-06-10 18:54 ` Mark Brown
2011-06-10 18:54 ` [linux-pm] " Mark Brown
2011-06-10 20:45 ` Rafael J. Wysocki
2011-06-10 20:45 ` [linux-pm] " Rafael J. Wysocki
2011-06-10 14:36 ` Mark Brown
2011-06-10 23:52 ` [linux-pm] " Kevin Hilman
2011-06-11 16:42 ` Alan Stern
2011-06-11 16:42 ` [linux-pm] " Alan Stern
2011-06-11 22:46 ` Rafael J. Wysocki
2011-06-11 22:46 ` [linux-pm] " Rafael J. Wysocki
2011-06-12 15:59 ` Alan Stern
2011-06-12 15:59 ` [linux-pm] " Alan Stern
2011-06-12 18:27 ` Rafael J. Wysocki
2011-06-12 18:27 ` [linux-pm] " Rafael J. Wysocki
2011-06-15 21:54 ` Kevin Hilman
2011-06-15 21:54 ` [linux-pm] " Kevin Hilman
2011-06-16 0:01 ` Rafael J. Wysocki
2011-06-16 0:01 ` [linux-pm] " Rafael J. Wysocki
2011-06-16 1:17 ` Kevin Hilman
2011-06-16 14:27 ` Alan Stern
2011-06-16 14:27 ` [linux-pm] " Alan Stern
2011-06-16 22:48 ` Rafael J. Wysocki
2011-06-17 19:47 ` Rafael J. Wysocki
2011-06-17 20:04 ` Alan Stern
2011-06-17 21:29 ` Rafael J. Wysocki
2011-06-17 21:29 ` [linux-pm] " Rafael J. Wysocki
2011-06-18 11:08 ` Rafael J. Wysocki
2011-06-18 11:08 ` [linux-pm] " Rafael J. Wysocki
2011-06-18 15:31 ` Alan Stern
2011-06-18 21:01 ` Rafael J. Wysocki
2011-06-18 21:01 ` [linux-pm] " Rafael J. Wysocki
2011-06-18 23:57 ` Rafael J. Wysocki
2011-06-18 23:57 ` [linux-pm] " Rafael J. Wysocki
2011-06-19 1:42 ` Alan Stern
2011-06-19 1:42 ` [linux-pm] " Alan Stern
2011-06-19 1:42 ` Alan Stern
2011-06-19 14:04 ` Rafael J. Wysocki
2011-06-19 15:01 ` Alan Stern
2011-06-19 15:01 ` Alan Stern
2011-06-19 19:36 ` Rafael J. Wysocki
2011-06-19 19:36 ` [linux-pm] " Rafael J. Wysocki
2011-06-20 14:39 ` Alan Stern
2011-06-20 14:39 ` [linux-pm] " Alan Stern
2011-06-20 14:39 ` Alan Stern
2011-06-20 19:53 ` Rafael J. Wysocki
2011-06-20 19:53 ` [linux-pm] " Rafael J. Wysocki
2011-06-19 15:01 ` Alan Stern
2011-06-19 14:04 ` Rafael J. Wysocki
2011-06-18 15:31 ` Alan Stern
2011-06-17 20:04 ` Alan Stern
2011-06-17 19:47 ` Rafael J. Wysocki
2011-06-16 22:48 ` Rafael J. Wysocki
2011-06-16 22:30 ` Rafael J. Wysocki
2011-06-16 22:30 ` [linux-pm] " Rafael J. Wysocki
2011-06-16 1:17 ` Kevin Hilman
2011-06-10 23:52 ` Kevin Hilman
2011-06-08 22:50 ` Kevin Hilman
2011-06-10 23:14 ` [linux-pm] " Kevin Hilman
2011-06-11 16:27 ` Alan Stern
2011-06-11 16:27 ` [linux-pm] " Alan Stern
2011-06-11 23:13 ` Rafael J. Wysocki
2011-06-11 23:13 ` [linux-pm] " Rafael J. Wysocki
2011-06-10 23:14 ` Kevin Hilman
2011-06-07 21:32 ` Rafael J. Wysocki
2011-06-06 22:25 ` Kevin Hilman
2011-06-02 17:10 ` Kevin Hilman
2011-06-02 14:18 ` Alan Stern
2011-06-06 18:01 ` Rafael J. Wysocki
2011-06-06 18:01 ` Rafael J. Wysocki
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=87hb80546c.fsf@ti.com \
--to=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=magnus.damm@gmail.com \
--cc=paul@pwsan.com \
--cc=rjw@sisk.pl \
--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 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.