From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>,
Magnus Damm <magnus.damm@gmail.com>, Greg KH <gregkh@suse.de>,
Pavel Machek <pavel@ucw.cz>, Len Brown <lenb@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH update x2] PM: Introduce core framework for run-time PM of I/O devices (rev. 13)
Date: Sun, 9 Aug 2009 22:49:53 +0200 [thread overview]
Message-ID: <200908092249.53401.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0908091100470.10326-100000@netrider.rowland.org>
On Sunday 09 August 2009, Alan Stern wrote:
> On Sun, 9 Aug 2009, Rafael J. Wysocki wrote:
>
> > > > How exactly would you like to implement it
> > > > instead?
> > >
> > > As described above. The barrier would be equivalent to
> > > pm_runtime_get_noresume followed by pm_runtime_disable except that it
> > > wouldn't actually disable anything.
> >
> > OK, I can do that, but the only difference between that and the above sequence
> > of three calls will be the possibility to call resume helpers while the
> > "barrier" is in progress.
>
> Exactly. In other words, if the driver tries to carry out a resume
> while the barrier is running, the resume won't get lost. Whereas with
> the temporarily-disable approach, it _would_ get lost.
>
> > Allowing runtime PM helpers to be run during system sleep transitions would be
> > problematic IMHO, because the run-time PM 'states' are not well defined at that
> > time. Consequently, the rules that the PM helpers follow do not really hold
> > during system sleep transitions.
>
> The workqueue will be frozen, so runtime PM helpers will run only if
> they are invoked more or less directly by the driver (i.e., through
> pm_runtime_resume, ...). I think we should allow drivers to do what
> they want, especially between the "prepare" and "suspend" stages.
Well, I'm not sure if that's a good idea, but also I have no good techincal
arguments against it at the moment. And I'm too tired to argue. ;-)
> > Also, in principle the device driver's ->suspend() routine (the non-runtime
> > one), or even the ->prepare() callback, may notice that the remote wake-up has
> > happened and put the device back into the full power state and return -EBUSY.
>
> It may. But then again, it may not -- it may depend on the runtime PM
> core to make sure that resume requests get forwarded appropriately.
>
> Furthermore, if you disable runtime PM _before_ calling the prepare
> method, that leaves a window during which the driver has no reason to
> realize that anything unusual is going on.
>
> > Still, we can allow runtime PM requests to be put into the workqueue during
> > system sleep transitions, to be executed after the resume (or in case the
> > suspend fails, that will make the action described in the previous paragraph
> > somewhat easier). It seems we'd need a separate flag for it, though.
>
> If every device gets resumed at the end of a system sleep, even the
> ones that were runtime-suspended before the sleep began, then there's
> no reason to preserve requests in the workqueue. But if
> previously-suspended devices don't get resumed at the end of a system
> sleep, then we should allow requests to remain in the workqueue.
We also should preserve the requests in case the system sleep transition
fails.
> In the end, it's probably safer and easier just to leave the workqueue
> alone -- freeze and unfreeze it, but don't meddle with its contents.
>
> The whole question of remote wakeup vs. runtime suspend vs. system
> sleep is complicated, and people haven't dealt with all the issues yet.
Agreed.
> For instance, it seems quite likely that with some devices you would
> want to enable remote wakeup during runtime suspend but not during
> system sleep. We don't have any good way to do this.
Yes, for now we have to assume that any device with wakeup enabled is a
wakeup device.
OK, I'll post the new version of the patch shortly. Please check if the
barrier mechanism is implemeted and used correctly.
Best,
Rafael
prev parent reply other threads:[~2009-08-09 20:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 21:36 [Resend][PATCH] PM: Introduce core framework for run-time PM of I/O devices (rev. 11) Rafael J. Wysocki
2009-08-04 20:33 ` Alan Stern
2009-08-05 0:19 ` Rafael J. Wysocki
2009-08-05 2:44 ` Alan Stern
2009-08-05 13:25 ` Rafael J. Wysocki
2009-08-05 21:47 ` [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 12) Rafael J. Wysocki
2009-08-06 17:01 ` Alan Stern
2009-08-06 21:50 ` Rafael J. Wysocki
2009-08-07 13:59 ` Alan Stern
2009-08-06 21:53 ` [PATCH update x2] PM: Introduce core framework for run-time PM of I/O devices (rev. 13) Rafael J. Wysocki
2009-08-07 7:45 ` Magnus Damm
2009-08-07 13:54 ` Rafael J. Wysocki
2009-08-07 15:41 ` Alan Stern
2009-08-08 14:03 ` Rafael J. Wysocki
2009-08-08 15:50 ` Alan Stern
2009-08-08 21:55 ` Rafael J. Wysocki
2009-08-09 2:28 ` Alan Stern
2009-08-09 13:10 ` Rafael J. Wysocki
2009-08-09 15:19 ` Alan Stern
2009-08-09 20:49 ` Rafael J. Wysocki [this message]
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=200908092249.53401.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=gregkh@suse.de \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=magnus.damm@gmail.com \
--cc=pavel@ucw.cz \
--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