]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: http://bugs.launchpad.net/bugs/1807469
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/core/hub.c

index 1bcd1755f97dc0c4ec024e19e6ba4a20848349c1..4ba4f61519cb36c647a40ae1b0639a0e768fa23f 100644 (file)
@@ -4532,7 +4532,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 =