summaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2013-05-17 12:08:51 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-20 11:28:55 -0700
commit9b790915450e2e2eb9a8df7fe32f41e895de9da1 (patch)
tree785b90ea1896347817fc2e43ddfe7eaca6cd6eaa /include/linux/usb.h
parentf23eb0ea9a7862263df338896b3ef415ca83ff51 (diff)
downloadlinux-9b790915450e2e2eb9a8df7fe32f41e895de9da1.tar.gz
linux-9b790915450e2e2eb9a8df7fe32f41e895de9da1.tar.bz2
linux-9b790915450e2e2eb9a8df7fe32f41e895de9da1.zip
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. In order to enable this optimization, the patch also adds a new usb_for_each_dev() iterator that is exported by the USB core and wraps bus_for_each_dev() with the logic to differentiate between struct usb_device and struct usb_interface on the usb_bus_type bus. Signed-off-by: Julius Werner <jwerner@chromium.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a0bee5a28d1a..b424e5318f20 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -717,6 +717,7 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface,
extern int usb_match_one_id(struct usb_interface *interface,
const struct usb_device_id *id);
+extern int usb_for_each_dev(void *data, int (*fn)(struct usb_device *, void *));
extern struct usb_interface *usb_find_interface(struct usb_driver *drv,
int minor);
extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,