]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Aug 2017 18:50:54 +0000 (11:50 -0700)
commit3464da8e8ab63f410888160e2c67cd9010735717
tree3f7abf5250dc1e956d69d0ef98ecacf8469ee069
parentca5ab3d5d8b93efd8ddbb3fed9e66ddfd4e302d8
USB: Check for dropped connection before switching to full speed

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 67358071102c ("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>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c