From: Magnus Damm <magnus.damm@gmail.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Oliver Neukum <oliver@neukum.org>,
linux-pm@lists.linux-foundation.org,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch update] Re: [linux-pm] Run-time PM idea (was: Re: [RFC][PATCH 0/2] PM: Rearrange core suspend code)
Date: Thu, 11 Jun 2009 14:18:46 +0900 [thread overview]
Message-ID: <aec7e5c30906102218j2f8f38dbt5d05a3928ca46c15@mail.gmail.com> (raw)
In-Reply-To: <200906101029.27529.rjw@sisk.pl>
Hi Rafael,
On Wed, Jun 10, 2009 at 5:29 PM, Rafael J. Wysocki<rjw@sisk.pl> wrote:
>> I tried to address your comments and the Oliver's comments too in the new
>> version of the patch below. Please have a look and tell me what you think.
>
> Argh, I forgot about some important things.
>
> First, there are devices with no parent (actually, it would be much easier if
> they had a default dummy parent, but that's a separate issue).
>
> Second, the parent has to be taken into account in the asynchronous resume
> path too (which BTW is more complicated).
>
> Finally, I decided to follow the Oliver's suggestion that some error codes returned
> by ->autosuspend() and ->autoresume() may be regarded as "go back to the
> previous state" information. I chose to use -EAGAIN and -EBUSY for this
> purpose.
>
> Updated patch follows, sorry for the confusion.
Thanks for your work on this. I think the patch looks very good in
general so I will not comment on the code itself. I do however have a
few high level questions:
Q1) Regarding pm_request_suspend(), would it be possible to get a
synchronous version or to make use of the completion somehow?
Q2) As pm_request_suspend() works today, the device is marked as
RPM_IDLE and the delayed work is queued up. There is no real decision
making going on except the time out. I'd like to let the bus code
decide when to autosuspend a buch of devices. Maybe the idle handling
should be broken out into a pm_request_idle() and pm_request_suspend()
can be modified to synchronously suspend devices marked with
pm_request_idle()?
Q3) Have you thought about how device drivers can inform the Runtime
PM that the device are idle and that they need the hardware to be
woken up? I'd like something similar to my "[PATCH 02/04] Driver Core:
Add idle and wakeup functions" patch but maybe not specific to
platform devices. We talked about adding some hooks to the bus_type
for this. Any ideas?
This is how I'm thinking of integrating your Runtime PM code with our
SuperH platform devices:
Device Idle Handling:
1) Device drivers call pm_device_idle() (See Q3) which invokes arch
specific platform bus code in the case of our SoC platform devices.
This bus code marks the device as idle using pm_request_idle(). (See
Q2). At this point light weight power management like clock stopping
may be performed as well.
2) The arch specific bus code knows how the platform devices are
grouped together (thanks to the data area in "[PATCH] Driver Core: Add
platform device arch data V3"), and when all devices in one power
domain are marked as idle the bus code calls the synchronous
pm_request_suspend() (no delay).
3) When all devices in the power domain are suspended the bus code can
turn off the power. The reason why I'd like to only autosuspend when
all devices are idle is simply that we don't get any power savings
from the per device autosuspend() callbacks, only from turning off
power to the entire per-domain. So bindly autosuspending and
autoresuming devices is just pure overhead unless we know we can do it
for all devices in the domain.
4) Over time when the code in 2) should be extended to handle latencies.
Device Wakeup Handling:
1) Device drivers call pm_device_wakeup() (See Q3). This invokes arch
specific bus code for our SoC platform devices. The bus code enables
clocks if needed and also calls pm_resume_sync().
2) After the call to pm_resume_sync() the pm_device_wakeup() call
returns and the device driver can access the hardware as usual.
That's it! Far from perfect but maybe a good start at least.
I have seen quite a few patches from you lately, nice work. To make
tracking of the Runtime PM patches easier, can you pleae consider
including the version of the patch in the subject when you post new
versions?
Thanks!
/ magnus
next prev parent reply other threads:[~2009-06-11 5:18 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-06 22:54 [RFC][PATCH 0/2] PM: Rearrange core suspend code Rafael J. Wysocki
2009-06-06 22:55 ` [RFC][PATCH 1/2] PM: Separate suspend to RAM functionality from core Rafael J. Wysocki
2009-06-08 6:36 ` Pavel Machek
2009-06-06 22:56 ` [RFC][PATCH 2/2] PM/Hibernate: Rename disk.c to hibernate.c Rafael J. Wysocki
2009-06-08 6:37 ` Pavel Machek
2009-06-07 20:51 ` [linux-pm] [RFC][PATCH 0/2] PM: Rearrange core suspend code Alan Stern
2009-06-07 21:46 ` Run-time PM idea (was: Re: [linux-pm] [RFC][PATCH 0/2] PM: Rearrange core suspend code) Rafael J. Wysocki
2009-06-07 22:02 ` Oliver Neukum
2009-06-07 22:05 ` [linux-pm] Run-time PM idea (was: " Oliver Neukum
2009-06-08 11:29 ` Rafael J. Wysocki
2009-06-08 12:04 ` Oliver Neukum
2009-06-08 18:34 ` Rafael J. Wysocki
2009-06-09 7:25 ` Oliver Neukum
2009-06-09 14:33 ` Alan Stern
2009-06-09 14:48 ` Oliver Neukum
2009-06-09 22:44 ` Rafael J. Wysocki
2009-06-08 20:35 ` Alan Stern
2009-06-08 21:31 ` Rafael J. Wysocki
2009-06-09 2:49 ` Alan Stern
2009-06-09 22:57 ` Rafael J. Wysocki
2009-06-10 8:29 ` [patch update] " Rafael J. Wysocki
2009-06-10 14:20 ` Oliver Neukum
2009-06-10 19:27 ` Rafael J. Wysocki
2009-06-10 21:38 ` Oliver Neukum
2009-06-10 22:01 ` Rafael J. Wysocki
2009-06-10 23:07 ` Oliver Neukum
2009-06-10 23:42 ` Alan Stern
2009-06-11 13:48 ` Rafael J. Wysocki
2009-06-11 13:57 ` Oliver Neukum
2009-06-11 14:16 ` Alan Stern
2009-06-11 19:38 ` Rafael J. Wysocki
2009-06-11 13:46 ` Rafael J. Wysocki
2009-06-10 21:14 ` Alan Stern
2009-06-10 21:31 ` Rafael J. Wysocki
2009-06-10 23:15 ` Oliver Neukum
2009-06-11 5:27 ` Magnus Damm
2009-06-10 23:42 ` Alan Stern
2009-06-11 14:17 ` Rafael J. Wysocki
2009-06-11 14:52 ` Alan Stern
2009-06-11 15:06 ` Oliver Neukum
2009-06-11 15:22 ` Alan Stern
2009-06-11 16:05 ` Oliver Neukum
2009-06-11 18:36 ` Alan Stern
2009-06-11 21:05 ` Oliver Neukum
2009-06-12 2:16 ` Alan Stern
2009-06-12 8:15 ` Oliver Neukum
2009-06-12 14:32 ` Alan Stern
2009-06-12 19:09 ` Rafael J. Wysocki
2009-06-12 19:48 ` Alan Stern
2009-06-12 19:56 ` Rafael J. Wysocki
2009-06-12 21:23 ` Alan Stern
2009-06-12 23:06 ` Rafael J. Wysocki
2009-06-13 18:08 ` Alan Stern
2009-06-13 22:04 ` Rafael J. Wysocki
2009-06-11 19:43 ` Rafael J. Wysocki
2009-06-12 14:25 ` Alan Stern
2009-06-11 5:18 ` Magnus Damm [this message]
2009-06-11 9:08 ` Oliver Neukum
2009-06-12 3:13 ` Magnus Damm
2009-06-12 8:11 ` Oliver Neukum
2009-06-12 10:54 ` Magnus Damm
2009-06-10 20:48 ` Alan Stern
2009-06-10 21:15 ` Rafael J. Wysocki
2009-06-09 7:31 ` Oliver Neukum
2009-06-09 23:02 ` Rafael J. Wysocki
2009-06-08 6:54 ` Run-time PM idea (was: Re: [linux-pm] " Ingo Molnar
2009-06-08 11:30 ` Rafael J. Wysocki
2009-06-08 13:05 ` Ingo Molnar
2009-06-08 13:11 ` Matthew Garrett
2009-06-08 13:22 ` Ingo Molnar
2009-06-08 13:32 ` Matthew Garrett
2009-06-08 13:46 ` Ingo Molnar
2009-06-08 13:54 ` Matthew Garrett
2009-06-08 14:24 ` Ingo Molnar
2009-06-08 14:35 ` Matthew Garrett
2009-06-08 14:44 ` Ingo Molnar
2009-06-08 14:51 ` Matthew Garrett
2009-06-24 15:03 ` Pavel Machek
2009-06-19 1:50 ` Run-time PM idea (was: " Robert Hancock
2009-06-08 13:58 ` Run-time PM idea (was: Re: [linux-pm] " Oliver Neukum
2009-06-08 13:39 ` Oliver Neukum
2009-06-08 13:44 ` Matthew Garrett
2009-06-08 14:21 ` Ingo Molnar
2009-06-08 14:30 ` Matthew Garrett
2009-06-08 15:06 ` Ingo Molnar
2009-06-08 15:11 ` Matthew Garrett
2009-06-08 16:29 ` Ray Lee
2009-06-09 22:44 ` Jiri Kosina
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=aec7e5c30906102218j2f8f38dbt5d05a3928ca46c15@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=oliver@neukum.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®