USB: XHCI: resume root hubs when the controller resumes
commita07b39fcd6a9aecdc4093f5b7480ba0bdfc85854
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 3 Nov 2011 15:37:10 +0000 (3 11:37 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 26 Nov 2011 17:10:01 +0000 (26 09:10 -0800)
treedb867b5a6c5364609c724cd44c36b13280814962
parent614b35af53468f13a41192ffb4ea34f264035b91
USB: XHCI: resume root hubs when the controller resumes

commit f69e3120df82391a0ee8118e0a156239a06b2afb upstream.

This patch (as1494) fixes a problem in xhci-hcd's resume routine.
When the controller is runtime-resumed, this can only mean that one of
the two root hubs has made a wakeup request and therefore needs to be
resumed as well.  Rather than try to determine which root hub requires
attention (which might be difficult in the case where a new
non-SuperSpeed device has been plugged in), the patch simply resumes
both root hubs.

Without this change, there is a race: The controller might be put back
to sleep before it can activate its IRQ line, and the wakeup condition
might never get handled.

The patch also simplifies the logic in xhci_resume a little, combining
some repeated flag settings into a single pair of statements.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci.c