]> git.hungrycats.org Git - linux/commitdiff
usb: do not reset if a low-speed or full-speed device timed out
authorMaxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
Thu, 4 Jan 2018 18:43:03 +0000 (21:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:21:27 +0000 (11:21 +0200)
commit 6e01827ed93947895680fbdad68c072a0f4e2450 upstream.

Some low-speed and full-speed devices (for example, bluetooth)
do not have time to initialize. For them, ETIMEDOUT is a valid error.
We need to give them another try. Otherwise, they will
never be initialized correctly and in dmesg will be messages
"Bluetooth: hci0 command 0x1002 tx timeout" or similars.

Fixes: 264904ccc33c ("usb: retry reset if a device times out")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c

index 6d84f6c8fbe6f11fc35cde24885d6fb6a2699e39..4d86da0df1319374cb6c30366374f29687e15cb8 100644 (file)
@@ -4442,7 +4442,9 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
                                 * reset. But only on the first attempt,
                                 * lest we get into a time out/reset loop
                                 */
-                               if (r == 0  || (r == -ETIMEDOUT && retries == 0))
+                               if (r == 0 || (r == -ETIMEDOUT &&
+                                               retries == 0 &&
+                                               udev->speed > USB_SPEED_FULL))
                                        break;
                        }
                        udev->descriptor.bMaxPacketSize0 =