]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
USB: Check for dropped connection before switching to full speed
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 1 Aug 2017 14:41:56 +0000 (10:41 -0400)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 22 Aug 2017 09:58:21 +0000 (06:58 -0300)
commit0bf4616156cd311aa72207f95144920e6c605a62
treea57d6dc9fad2f7c740f31a7297f8d337d66ec84f
parent64bce3509da82ef596528538b6c5ee73573d5f04
USB: Check for dropped connection before switching to full speed

BugLink: http://bugs.launchpad.net/bugs/1711557
commit 94c43b9897abf4ea366ed4dba027494e080c7050 upstream.

Some buggy USB disk adapters disconnect and reconnect multiple times
during the enumeration procedure.  This may lead to a device
connecting at full speed instead of high speed, because when the USB
stack sees that a device isn't able to enumerate at high speed, it
tries to hand the connection over to a full-speed companion
controller.

The logic for doing this is careful to check that the device is still
connected.  But this check is inadequate if the device disconnects and
reconnects before the check is done.  The symptom is that a device
works, but much more slowly than it is capable of operating.

The situation was made worse recently by commit 22547c4cc4fe ("usb:
hub: Wait for connection to be reestablished after port reset"), which
increases the delay following a reset before a disconnect is
recognized, thus giving the device more time to reconnect.

This patch makes the check more robust.  If the device was
disconnected at any time during enumeration, we will now skip the
full-speed handover.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Zdenek Kabelac <zkabelac@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/usb/core/hub.c