From: Maxim Moseychuk Date: Thu, 4 Jan 2018 18:43:03 +0000 (+0300) Subject: usb: do not reset if a low-speed or full-speed device timed out X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3c22218ed86921ac18b4554093a1034feb3ebb5b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: do not reset if a low-speed or full-speed device timed out 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 Signed-off-by: Maxim Moseychuk Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 442be7f312f6..e5f77e611451 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4519,7 +4519,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 =