Skip to content

Commit bd0e6c9

Browse files
prime-zenggregkh
authored andcommitted
usb: hub: try old enumeration scheme first for high speed devices
The new scheme is required just to support legacy low and full-speed devices. For high speed devices, it will slower the enumeration speed. So in this patch we try the "old" enumeration scheme first for high speed devices, and this is what Windows does since Windows 8. Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2cfe8f8 commit bd0e6c9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4610,7 +4610,8 @@
46104610

46114611
usbcore.old_scheme_first=
46124612
[USB] Start with the old device initialization
4613-
scheme (default 0 = off).
4613+
scheme, applies only to low and full-speed devices
4614+
(default 0 = off).
46144615

46154616
usbcore.usbfs_memory_mb=
46164617
[USB] Memory limit (in MB) for buffers allocated by

drivers/usb/core/hub.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,11 +2661,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry,
26612661
{
26622662
int old_scheme_first_port =
26632663
port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
2664+
int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
26642665

26652666
if (udev->speed >= USB_SPEED_SUPER)
26662667
return false;
26672668

2668-
return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first);
2669+
return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first
2670+
|| quick_enumeration);
26692671
}
26702672

26712673
/* Is a USB 3.0 port in the Inactive or Compliance Mode state?

0 commit comments

Comments
 (0)