Skip to contentSkip to conversation

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

PATCH New Greg Kroah-Hartman 1 participant 1 message Mar 23, 2018 USB

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH v2 1/1 usb: do not reset if a low-speed or full-speed device timed out

Quoted 18 lines · Maxim Moseychuk

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 <[email protected]>
---
 drivers/usb/core/hub.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/core/hub.c +0 -0
index cf7bbcb9a63c..775d97035503 100644

drivers/usb/core/hub.c hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, · line 4530

Quoted 8 lines
drivers/usb/core/hub.c +3 -1
@@ -4524,7 +4524,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;

But can't we now get into a loop where this never happens? We still need to "fail" these slow devices somehow.

Do you have a device that this fixes a problem for? I would think we would have seen this issue before now, given that this change has been present in the tree for quite some time now.

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html