Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa071a92 authored by Nicolas Boichat's avatar Nicolas Boichat Committed by Greg Kroah-Hartman
Browse files

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 (b789696a "[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: default avatarNicolas Boichat <drinkcat@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 25244227
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -206,6 +206,10 @@ Description:
		   using /sys/module/usbcore/parameters/old_scheme_first, but
		   using /sys/module/usbcore/parameters/old_scheme_first, but
		   it is often not desirable as the new scheme was introduced to
		   it is often not desirable as the new scheme was introduced to
		   increase compatibility with more devices.
		   increase compatibility with more devices.
		 - Bit 1 reduces TRSTRCY to the 10 ms that are required by the
		   USB 2.0 specification, instead of the 50 ms that are normally
		   used to help make enumeration work better on some high speed
		   devices.


What:		/sys/bus/usb/devices/.../(hub interface)/portX/over_current_count
What:		/sys/bus/usb/devices/.../(hub interface)/portX/over_current_count
Date:		February 2018
Date:		February 2018
+5 −1
Original line number Original line Diff line number Diff line
@@ -2879,7 +2879,11 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
done:
done:
	if (status == 0) {
	if (status == 0) {
		/* TRSTRCY = 10 ms; plus some extra */
		/* TRSTRCY = 10 ms; plus some extra */
		if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM)
			usleep_range(10000, 12000);
		else
			msleep(10 + 40);
			msleep(10 + 40);

		if (udev) {
		if (udev) {
			struct usb_hcd *hcd = bus_to_hcd(udev->bus);
			struct usb_hcd *hcd = bus_to_hcd(udev->bus);


+3 −0
Original line number Original line Diff line number Diff line
@@ -496,6 +496,9 @@ enum usb_port_connect_type {
/* For the given port, prefer the old (faster) enumeration scheme. */
/* For the given port, prefer the old (faster) enumeration scheme. */
#define USB_PORT_QUIRK_OLD_SCHEME	BIT(0)
#define USB_PORT_QUIRK_OLD_SCHEME	BIT(0)


/* Decrease TRSTRCY to 10ms during device enumeration. */
#define USB_PORT_QUIRK_FAST_ENUM	BIT(1)

/*
/*
 * USB 2.0 Link Power Management (LPM) parameters.
 * USB 2.0 Link Power Management (LPM) parameters.
 */
 */