public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	Oliver Neukum <oliver@neukum.org>,
	linux-acpi@vger.kernel.org, USB list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: Add support for runtime power management of the hcd
Date: Wed, 11 Nov 2009 23:15:36 +0100	[thread overview]
Message-ID: <200911112315.36073.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0911100949500.2888-100000@iolanthe.rowland.org>

[Sorry for the delayed response, I was distracted by the btusb regression
causing resume to fail on my box.]

On Tuesday 10 November 2009, Alan Stern wrote:
> On Tue, 10 Nov 2009, Matthew Garrett wrote:
> 
> > On Tue, Nov 10, 2009 at 02:08:01PM +0100, Oliver Neukum wrote:
> > 
> > > I was wondering because a tester has reported a race in ehci that
> > > can lead to a loss of wakeup events. Alan posted a patch to fix it.
> > > Does it cooperate with your patch?
> > 
> > Hm. I'll look into that.
> 
> There should not be any interaction.  That particular race occurs when
> the root hub is suspended, not when the controller is suspended.
> 
> 
> But this does raise an interesting point.  We do still have a race 
> between remote wakeup and system sleep.

We do to some extent.  There is the check in dpm_prepare() that will abort
system sleep transitions if run-time wake-up has been requested earlier,
but later requests will be discarded.

> Suppose we're in the middle of a system sleep transition, and device D
> (such as a USB root hub) has been suspended as part of the normal
> preparation.  But then D generates a remote wakeup IRQ.
> 
> D's driver will field the interrupt request and will call something
> like pm_request_resume(), to schedule a workqueue item for a runtime
> resume of D.  However, the runtime-PM workqueues are either frozen or
> in some other way prevented from doing anything while the system sleep
> transition is in progress.
> 
> Therefore the wakeup request will get lost.  The information is still
> present, in the form of a work_struct, but it won't get acted on until
> the system wakes up.  In particular, it won't prevent the sleep
> transition from completing and it won't cause the system to wake up
> immediately after going to sleep.
> 
> This suggests that pm_request_resume() should abort a sleep transition
> if one is already in progress.  Rafael, what do you think?

That's not an easy question, becuase there always will be a point after which
we can't handle a run-time resume request.  If we are deep enough into the
suspend process, we won't receive wakeup interrupts any more, at least on
some platforms.

Thanks,
Rafael

  parent reply	other threads:[~2009-11-11 22:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09 22:43 [PATCH] usb: Add support for runtime power management of the hcd Matthew Garrett
2009-11-10  8:20 ` Oliver Neukum
     [not found]   ` <200911100920.03361.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-11-10 12:41     ` Matthew Garrett
     [not found]       ` <20091110124109.GA18631-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-11-10 13:08         ` Oliver Neukum
     [not found]           ` <200911101408.01867.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-11-10 14:12             ` Matthew Garrett
     [not found]               ` <20091110141259.GA19792-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-11-10 15:04                 ` Alan Stern
     [not found]                   ` <Pine.LNX.4.44L0.0911100949500.2888-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-11-11 11:34                     ` Oliver Neukum
     [not found]                       ` <200911111234.43867.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-11-11 17:08                         ` Alan Stern
2009-11-11 17:27                           ` Oliver Neukum
2009-11-11 19:06                             ` Alan Stern
     [not found]                               ` <Pine.LNX.4.44L0.0911111400370.6882-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-11-11 22:24                                 ` Rafael J. Wysocki
2009-11-11 23:09                                   ` Alan Stern
2009-11-12  0:33                                     ` Matthew Garrett
2009-11-12  7:41                                       ` Oliver Neukum
2009-11-12 14:51                                         ` Matthew Garrett
2009-11-12 16:50                                           ` Alan Stern
     [not found]                                           ` <20091112145121.GB6709-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-11-12 17:00                                             ` Oliver Neukum
2009-11-12 16:59                                               ` Matthew Garrett
     [not found]                                                 ` <20091112165958.GA9389-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-11-16 21:26                                                   ` Oliver Neukum
2009-11-16 22:26                                                     ` Rafael J. Wysocki
     [not found]                                       ` <20091112003312.GA27572-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2009-11-12 16:22                                         ` Alan Stern
2009-11-12 14:44                                     ` Oliver Neukum
     [not found]                                       ` <200911121544.19313.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-11-12 16:47                                         ` Alan Stern
2009-11-12 10:31                                   ` Oliver Neukum
2009-11-12 14:50                                     ` Matthew Garrett
2009-11-11 22:15                   ` Rafael J. Wysocki [this message]
2009-11-11 23:05                     ` Alan Stern
2009-11-11 21:36               ` 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=200911112315.36073.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=oliver@neukum.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