aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeng Tao <prime.zeng@hisilicon.com>2018-09-28 07:27:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-02 15:05:30 -0400
commitbd0e6c9614b95352eb31d0207df16dc156c527fa (patch)
tree274c7a7b59d5b149f183371dff221a52f292a9b4
parent2cfe8f864d0e2504dc2f68f0b04668d877f7c7b4 (diff)
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>
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt3
-rw-r--r--drivers/usb/core/hub.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 92eb1f42240d..151c527571e5 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4610,7 +4610,8 @@
4610 4610
4611 usbcore.old_scheme_first= 4611 usbcore.old_scheme_first=
4612 [USB] Start with the old device initialization 4612 [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).
4614 4615
4615 usbcore.usbfs_memory_mb= 4616 usbcore.usbfs_memory_mb=
4616 [USB] Memory limit (in MB) for buffers allocated by 4617 [USB] Memory limit (in MB) for buffers allocated by
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 7801bb30bdba..bf76a3dd4359 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2661,11 +2661,13 @@ static bool use_new_scheme(struct usb_device *udev, int retry,
2661{ 2661{
2662 int old_scheme_first_port = 2662 int old_scheme_first_port =
2663 port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME; 2663 port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME;
2664 int quick_enumeration = (udev->speed == USB_SPEED_HIGH);
2664 2665
2665 if (udev->speed >= USB_SPEED_SUPER) 2666 if (udev->speed >= USB_SPEED_SUPER)
2666 return false; 2667 return false;
2667 2668
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);
2669} 2671}
2670 2672
2671/* Is a USB 3.0 port in the Inactive or Compliance Mode state? 2673/* Is a USB 3.0 port in the Inactive or Compliance Mode state?