From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 00/04][RFC] PM: Runtime platform device PM
Date: Mon, 01 Jun 2009 19:58:25 +0000 [thread overview]
Message-ID: <200906012158.26658.rjw@sisk.pl> (raw)
In-Reply-To: <20090527100625.29671.43166.sendpatchset@rx1.opensource.se>
On Monday 01 June 2009, Alan Stern wrote:
> On Mon, 1 Jun 2009, Rafael J. Wysocki wrote:
>
> > On Thursday 28 May 2009, Alan Stern wrote:
> > > On Thu, 28 May 2009, Rafael J. Wysocki wrote:
> > >
> > > > I think we'll need one separate workqueue for run-time PM in general, so that
> > > > bus types don't introduce their own workqueues for this purpose. IMO one
> > > > system-wide run-time PM workqueue should be sufficient (it could also be
> > > > used for the suspend blockers BTW).
> > > >
> > > > So, perhaps it makes sense to implement such a workqueue at the core level?
> > > > Thoughts?
> > >
> > > That's fine with me. This new workqueue can take over the job of the
> > > "ksuspend_usbd" workqueue. But it would have to be marked as
> > > freezable.
> >
> > Having considered it for a while I'm not sure if freezing is the right approach
> > here. Namely, the work items put into the workqueue need not be useful after
> > the resume any more, so perhaps we should deqeue them during suspend?
>
> With USB at least, this isn't true. Some work items shouldn't be
> dequeued, namely, various sorts of resume requests generated while the
> driver is in interrupt context. If they were dequeued during a system
> suspend then the device wouldn't ever be woken up, because usbcore
> doesn't pass system-resume messages to an autosuspended device. The
> idea is if a device was autosuspended before the system sleep then it
> should remain autosuspended after the system wakes up.
Hmm, well, I'm not sure, really. During a system-wide resume, does it really
matter if devices were autosuspended before the preceding suspend or they have
been suspended by the PM core? Also, what happens if the platform firmware
resumes the autosuspended devices before passing control to the kernel during
system-wide resume? How do we handle that?
Moreover, what if the autosuspended device is no longer present in the system
after a system-wide resume. Are we still going to attempt to autoresume it?
> Furthermore, even if the existing work items were dequeued, you'd still
> have to worry about new work items added on by drivers before they get
> suspended. If the workqueue were allowed to run freely, we might find
> devices being autoresumed in the middle of the sleep transition!
Unless there's some other kind of synchronization between the workqueue and the
core suspend-resume code.
IMO, it would be convenient to treat every system-wide suspend (or hibernation)
as a cancellation point for all of the pending autosuspend and autoresume
requests and to treat devices autosuspended before that point as just
suspended. Of course, the bus type and device driver suspend callbacks would
have to be prepared to handle this situation cleanly.
Best,
Rafael
next prev parent reply other threads:[~2009-06-01 19:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 10:06 [PATCH 00/04][RFC] PM: Runtime platform device PM Magnus Damm
2009-05-27 12:10 ` [linux-pm] " Mark Brown
2009-05-27 14:30 ` Alan Stern
2009-05-28 0:32 ` Kevin Hilman
2009-05-28 6:02 ` [linux-pm] " Magnus Damm
2009-05-28 6:14 ` Magnus Damm
2009-05-28 7:12 ` Rafael J. Wysocki
2009-05-28 15:28 ` Alan Stern
2009-05-28 15:33 ` Alan Stern
2009-05-28 17:14 ` Kevin Hilman
2009-05-29 7:41 ` Magnus Damm
2009-05-29 13:45 ` Alan Stern
2009-05-29 9:17 ` Magnus Damm
2009-05-29 18:18 ` Rafael J. Wysocki
2009-06-01 19:04 ` Rafael J. Wysocki
2009-06-01 19:31 ` Alan Stern
2009-06-01 19:58 ` Rafael J. Wysocki [this message]
2009-06-01 22:16 ` Alan Stern
2009-06-01 23:21 ` Rafael J. Wysocki
2009-06-02 13:44 ` Magnus Damm
2009-06-02 14:51 ` Alan Stern
2009-06-02 21:37 ` [linux-pm] " Pavel Machek
2009-06-04 10:03 ` Magnus Damm
2009-06-04 16:30 ` Rafael J. Wysocki
2009-07-18 11:49 ` [linux-pm] " Pavel Machek
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=200906012158.26658.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-sh@vger.kernel.org \
/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