From 3406e9d8afcc8ade8cb3e697be2bcf9cc85c9d04 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 30 Oct 2022 23:38:35 +0100 Subject: usb: Add 1ms delay after first Get Descriptor request Logitech Unifying Receiver 046d:c52b bcdDevice 12.10 seems sensitive about the first Get Descriptor request. If there are any other requests in the same microframe, the device reports bogus data, first of the descriptor parts is not sent to the host. Wait over one microframe duration before issuing subsequent requests to avoid probe failure with this device, since it can be used to connect USB keyboards. Signed-off-by: Marek Vasut Tested-by: Janne Grunau --- common/usb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common') diff --git a/common/usb.c b/common/usb.c index 6fcf1e8428e..ae9253dfc0e 100644 --- a/common/usb.c +++ b/common/usb.c @@ -999,6 +999,17 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read) err = get_descriptor_len(dev, 64, 8); if (err) return err; + + /* + * Logitech Unifying Receiver 046d:c52b bcdDevice 12.10 seems + * sensitive about the first Get Descriptor request. If there + * are any other requests in the same microframe, the device + * reports bogus data, first of the descriptor parts is not + * sent to the host. Wait over one microframe duration here + * (1mS for USB 1.x , 125uS for USB 2.0) to avoid triggering + * the issue. + */ + mdelay(1); } dev->epmaxpacketin[0] = dev->descriptor.bMaxPacketSize0; -- cgit v1.2.3 From 04448899de702321c018d0c4be2f6cc1d2f06760 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 4 Nov 2022 08:38:59 +0100 Subject: usb: storage: continue probe on "Invalid device" Fixes a crash during probing of sd card readers without medium present. Seen with the device below but reported for many other devices. idVendor 0x0bda Realtek Semiconductor Corp. idProduct 0x0326 Card reader bcdDevice 11.24 iManufacturer 1 Realtek iProduct 2 USB3.0 Card Reader iSerial 3 201404081410 Link: https://github.com/AsahiLinux/linux/issues/44 Link: https://lists.denx.de/pipermail/u-boot/2022-July/489717.html Signed-off-by: Janne Grunau Reviewed-by: Simon Glass Reviewed-by: Marek Vasut --- common/usb_storage.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/usb_storage.c b/common/usb_storage.c index e59c819bac5..ac642757737 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -239,6 +239,7 @@ static int usb_stor_probe_device(struct usb_device *udev) ret = device_unbind(dev); if (ret) return ret; + continue; } ret = blk_probe_or_unbind(dev); -- cgit v1.2.3