mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	linux-usb@vger.kernel.org, Greg KH <gregkh@suse.de>,
	Arjan van de Ven <arjan@infradead.org>,
	Nigel Cunningham <ncunningham@crca.org.au>
Subject: Re: [PATCH 2/8] PM: Asynchronous suspend and resume of devices
Date: Mon, 25 Jan 2010 00:27:42 +0100	[thread overview]
Message-ID: <201001250027.42621.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1001241712490.441-100000@netrider.rowland.org>

On Sunday 24 January 2010, Alan Stern wrote:
> On Sun, 24 Jan 2010, Rafael J. Wysocki wrote:
> 
> > > There needs to be a public interface to this function available for 
> > > drivers that have non-tree constraints.  The arguments should be the 
> > > device to wait for and the device doing the waiting (needed only to 
> > > determine whether the caller is running synchronously or not).
> > 
> > Something like the patch below?
> 
> Yes, exactly.  Thanks.

OK, I'll put it into the patchset after 5/8.

> > > This will be necessary for USB.  In fact, your current code (with patch 
> > > 7/8 applied) is subject to a race that will sometimes cause a 
> > > non-high-speed USB device to fail to resume from hibernation.
> > 
> > That's the kind of information I need at this point.  What exactly should be
> > added to patch 7/8 to avoid this problem?
> 
> I don't think there's anything you can do about it, really.  It's an
> obscure USB issue: If an EHCI controller was reset or loses power
> during a system sleep (which always happens with hibernation and
> sometimes happens with suspend-to-RAM, depending on the chipset and
> firmware), then the EHCI controller must be resumed after all its
> sibling companion OHCI/UHCI controllers, and USB devices below the
> companion root hubs must be resumed after the EHCI root hub.
> 
> With synchronous resume this happens automatically because the devices
> in question are always registered in the appropriate order.  But the
> only way to meet these constraints with async resume is to add specific
> code to the USB core to enforce the non-tree orderings.
> 
> I intend to write this code, but merging it will be a little tricky.  
> You'll have to coordinate with Greg KH.

OK, I don't think that's a big deal.  I can defer patch 7/8 until that code has
been merged.

> If you have a non-high-speed USB device, you can test to see if this
> problem is not just a figment of my imagination.  To violate the first
> constraint, add an ssleep(1) to the beginning of ohci_pci_resume() in
> drivers/usb/host/ohci-pci.c or to the beginning of uhci_pci_resume() in
> drivers/usb/host/uhci-hcd.c (depending on whether your companion
> controllers are OHCI or UHCI).  To violate the second constraint, add
> an ssleep(1) to the beginning of ehci_bus_resume() in
> drivers/usb/host/ehci-hub.c.  Either constraint violation should cause
> the device to be disconnected and then reconnected during an async
> resume from hibernation, as opposed to simply being reset.

I'll try that, but my mkinitrd automatically puts the USB drivers into
initramfs.  I guess I'll need to do some research to really verify it. :-)

Rafael

  reply	other threads:[~2010-01-24 23:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-23 23:33 [PATCH 0/8] PM: Asynchronous suspen and resume Rafael J. Wysocki
2010-01-23 23:34 ` [PATCH 1/8] PM: Add parent information to timing messages Rafael J. Wysocki
2010-02-25  7:01   ` Pavel Machek
2010-01-23 23:35 ` [PATCH 2/8] PM: Asynchronous suspend and resume of devices Rafael J. Wysocki
2010-01-24 16:37   ` Alan Stern
2010-01-24 20:09     ` Rafael J. Wysocki
2010-01-24 22:30       ` Alan Stern
2010-01-24 23:27         ` Rafael J. Wysocki [this message]
2010-01-25  3:12           ` Alan Stern
2010-01-25 21:26             ` Rafael J. Wysocki
2010-01-25 22:04               ` Alan Stern
2010-01-23 23:36 ` [PATCH 3/8] PM: Add a switch for disabling/enabling asynchronous suspend/resume Rafael J. Wysocki
2010-01-23 23:38 ` [PATCH 4/8] PM: Add facility for advanced testing of async suspend/resume Rafael J. Wysocki
2010-01-23 23:38 ` [PATCH 5/8] PM: Start asynchronous resume threads upfront Rafael J. Wysocki
2010-01-23 23:39 ` [PATCH 6/8] PM: Allow PCI devices to suspend/resume asynchronously Rafael J. Wysocki
2010-01-23 23:40 ` [PATCH 7/8] PM: Allow USB " Rafael J. Wysocki
2010-01-23 23:41 ` [PATCH 8/8] PM: Allow SCSI " 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=201001250027.42621.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=arjan@infradead.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ncunningham@crca.org.au \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®