CHROMIUM: usb: ehci: Only sleep for post-resume handover if devices use persist
authorJulius Werner <jwerner@chromium.org>
Sat, 20 Apr 2013 01:16:34 +0000 (18:16 -0700)
committerChromeBot <chrome-bot@google.com>
Tue, 7 May 2013 07:03:28 +0000 (00:03 -0700)
commit2b2443e0c7e4dc5fa47f3e67026293d908aee227
tree1344a398feb93c67d275473b8929f093f7756a76
parent7ecb1cc1462ef33a4cbfd62e14ebc6efc18635f6
CHROMIUM: usb: ehci: Only sleep for post-resume handover if devices use persist

The current EHCI code sleeps a flat 110ms in the resume path if there
was a USB 1.1 device connected to its companion controller during
suspend, waiting for the device to reappear and reset so that it can be
handed back to the companion. This is necessary if the device uses
persist, so that the companion controller can actually see it during its
own resume path.

However, if the device doesn't use persist, this is entirely
unnecessary. We might just as well ignore it and have the normal device
detection/reset/handoff code handle it asynchronously when it eventually
shows up. As USB 1.1 devices are almost exclusively HIDs these days (for
which persist has no value), this can allow distros to shave another
tenth of a second off their resume time.

BUG=chromium:222484
TEST=Suspend/resume Snow with a USB keyboard plugged in, make sure
keyboard still works afterwards.

Has been sent upstream, chances for merge were looking good...

Change-Id: I3bc9a86e464a70231cfdd1b013ef0a0cb98eff09
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48945
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
drivers/usb/core/usb.c
drivers/usb/host/ehci-hub.c
include/linux/usb.h