USB: EHCI: add delay during suspend to prevent erroneous wakeups
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 13 Feb 2014 20:49:17 +0000 (15:49 -0500)
committerJiri Slaby <jslaby@suse.cz>
Wed, 5 Mar 2014 16:13:49 +0000 (17:13 +0100)
commitb2f20b15e450bb7f1b7f8c67647dc3815b127ca5
tree645022754fdbefb7a7164a05d464218ef9f36098
parent1147f2e9f9227a83fa649a752590f385975b6180
USB: EHCI: add delay during suspend to prevent erroneous wakeups

commit 3e8d6d85adedc59115a564c0a54b36e42087c4d9 upstream.

High-speed USB connections revert back to full-speed signalling when
the device goes into suspend.  This takes several milliseconds, and
during that time it's not possible to tell reliably whether the device
has been disconnected.

On some platforms, the Wake-On-Disconnect circuitry gets confused
during this intermediate state.  It generates a false wakeup signal,
which can prevent the controller from going to sleep.

To avoid this problem, this patch adds a 5-ms delay to the
ehci_bus_suspend() routine if any ports have to switch over to
full-speed signalling.  (Actually, the delay was already present for
devices using a particular kind of PHY power management; the patch
merely causes the delay to be used more widely.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Peter Chen <Peter.Chen@freescale.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/usb/host/ehci-hub.c