EHCI: fix bug in keeping track of resuming ports
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 8 Feb 2010 14:43:22 +0000 (09:43 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:52:18 +0000 (15:52 -0700)
commit88b60df09c5ce701e308e27932fcf1c8a6bc6375
treeeb8a0b0dbf3bffbc12296fa25066e904ceaf0462
parente2db86fdddfbf179ebc8e717b50770cf7acf78b6
EHCI: fix bug in keeping track of resuming ports

This patch fixes a bug caused by backporting commit
cec3a53c7fe794237b582e8e77fc0e48465e65ee (USB: EHCI & UHCI: fix race
between root-hub suspend and port resume) to 2.6.27.stable without
also backporting commit eafe5b99f2135488b21cf17a262c54997c44f784 (USB:
EHCI: fix remote-wakeup support for ARC/TDI core).  This extracts the
necessary changes from the earlier patch and backports them.

The symptom of the bug is that the system will fail to suspend more
than once.  The problem is caused by setting ehci->reset_done[i] but
never clearing it.  When ehci_bus_suspend() sees a nonzero value
there, it assumes this means the port is in the middle of resuming so
it aborts the bus suspend.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Corey Wright <undefined@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-hub.c