Commit 2e1a1fab authored by Maxim Moseychuk's avatar Maxim Moseychuk Committed by Stefan Bader

usb: do not reset if a low-speed or full-speed device timed out

BugLink: https://bugs.launchpad.net/bugs/1784382

commit 6e01827e 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: 264904cc ("usb: retry reset if a device times out")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarMaxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 83a3a863
...@@ -4494,7 +4494,9 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, ...@@ -4494,7 +4494,9 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
* reset. But only on the first attempt, * reset. But only on the first attempt,
* lest we get into a time out/reset loop * 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; break;
} }
udev->descriptor.bMaxPacketSize0 = udev->descriptor.bMaxPacketSize0 =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment