Skip to content

Commit ef501a7

Browse files
oneukumDmitry Shmidt
authored andcommitted
usb: retry reset if a device times out
commit 264904c upstream. Some devices I got show an inability to operate right after power on if they are already connected. They are beyond recovery if the descriptors are requested multiple times. So in case of a timeout we rather bail early and reset again. But it must be done only on the first loop lest we get into a reset/time out spiral that can be overcome with a retry. This patch is a rework of a patch that fell through the cracks. http://www.spinics.net/lists/linux-usb/msg103263.html Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b7d1bde commit ef501a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4426,7 +4426,13 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
44264426
r = -EPROTO;
44274427
break;
44284428
}
4429-
if (r == 0)
4429+
/*
4430+
* Some devices time out if they are powered on
4431+
* when already connected. They need a second
4432+
* reset. But only on the first attempt,
4433+
* lest we get into a time out/reset loop
4434+
*/
4435+
if (r == 0 || (r == -ETIMEDOUT && j == 0))
44304436
break;
44314437
}
44324438
udev->descriptor.bMaxPacketSize0 =

0 commit comments

Comments
 (0)