USB: add missing delay during remote wakeup
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 8 Jan 2010 16:18:38 +0000 (11:18 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 25 Jan 2010 18:49:33 +0000 (10:49 -0800)
commita2a5b33aa3675f267259604218d0663b9778227f
treedad95fd36b66608e9a3b436ee9e5dd2f4472245d
parentbfec5cee7784fdc9c07c9ef72312dbad0bff5690
USB: add missing delay during remote wakeup

commit 49d0f078f494b9d81e820a13dd8093a9bfb0b6b1 upstream.

This patch (as1330) fixes a bug in khbud's handling of remote
wakeups.  When a device sends a remote-wakeup request, the parent hub
(or the host controller driver, for directly attached devices) begins
the resume sequence and notifies khubd when the sequence finishes.  At
this point the port's SUSPEND feature is automatically turned off.

However the device needs an additional 10-ms resume-recovery time
(TRSMRCY in the USB spec).  Khubd does not wait for this delay if the
SUSPEND feature is off, and as a result some devices fail to behave
properly following a remote wakeup.  This patch adds the missing
delay to the remote-wakeup path.

It also extends the resume-signalling delay used by ehci-hcd and
uhci-hcd from 20 ms (the value in the spec) to 25 ms (the value we use
for non-remote-wakeup resumes).  The extra time appears to help some
devices.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Rickard Bellini <rickard.bellini@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hub.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/uhci-hub.c