Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: hub: Per-port setting to reduce TRSTRCY to 10 ms

Currently, the USB hub core waits for 50 ms after enumerating the
device. This was added to help "some high speed devices" to
enumerate (b789696af8 "[PATCH] USB: relax usbcore reset timings").

On some devices, the time-to-active is important, so we provide
a per-port option to reduce the time to what the USB specification
requires: 10 ms.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nicolas Boichat and committed by
Greg Kroah-Hartman
aa071a92 25244227

+12 -1
+4
Documentation/ABI/testing/sysfs-bus-usb
··· 206 206 using /sys/module/usbcore/parameters/old_scheme_first, but 207 207 it is often not desirable as the new scheme was introduced to 208 208 increase compatibility with more devices. 209 + - Bit 1 reduces TRSTRCY to the 10 ms that are required by the 210 + USB 2.0 specification, instead of the 50 ms that are normally 211 + used to help make enumeration work better on some high speed 212 + devices. 209 213 210 214 What: /sys/bus/usb/devices/.../(hub interface)/portX/over_current_count 211 215 Date: February 2018
+5 -1
drivers/usb/core/hub.c
··· 2879 2879 done: 2880 2880 if (status == 0) { 2881 2881 /* TRSTRCY = 10 ms; plus some extra */ 2882 - msleep(10 + 40); 2882 + if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) 2883 + usleep_range(10000, 12000); 2884 + else 2885 + msleep(10 + 40); 2886 + 2883 2887 if (udev) { 2884 2888 struct usb_hcd *hcd = bus_to_hcd(udev->bus); 2885 2889
+3
include/linux/usb.h
··· 496 496 /* For the given port, prefer the old (faster) enumeration scheme. */ 497 497 #define USB_PORT_QUIRK_OLD_SCHEME BIT(0) 498 498 499 + /* Decrease TRSTRCY to 10ms during device enumeration. */ 500 + #define USB_PORT_QUIRK_FAST_ENUM BIT(1) 501 + 499 502 /* 500 503 * USB 2.0 Link Power Management (LPM) parameters. 501 504 */