usb: hub: try old enumeration scheme first for high speed devices
authorZeng Tao <prime.zeng@hisilicon.com>
Fri, 28 Sep 2018 11:27:52 +0000 (19:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2018 19:05:30 +0000 (12:05 -0700)
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>
Documentation/admin-guide/kernel-parameters.txt
drivers/usb/core/hub.c

index 92eb1f42240d7168354dc7129898e2500ef95c1a..151c527571e56e14e7466f9dcdb1b867fb1bce2b 100644 (file)
 
        usbcore.old_scheme_first=
                        [USB] Start with the old device initialization
-                       scheme (default 0 = off).
+                       scheme,  applies only to low and full-speed devices
+                        (default 0 = off).
 
        usbcore.usbfs_memory_mb=
                        [USB] Memory limit (in MB) for buffers allocated by
index 7801bb30bdbaa240cf734905f3da77e666b25423..bf76a3dd4359dd722fffbdd231c3b1ef06a3d5d8 100644 (file)
@@ -2661,11 +2661,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry,
 {
        int old_scheme_first_port =
                port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
+       int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
 
        if (udev->speed >= USB_SPEED_SUPER)
                return false;
 
-       return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first);
+       return USE_NEW_SCHEME(retry, old_scheme_first_port || old_scheme_first
+                             || quick_enumeration);
 }
 
 /* Is a USB 3.0 port in the Inactive or Compliance Mode state?