[PATCH 1/1] usb: request only 8 bytes for USB_SPEED_FULL bMaxPacketSize0 discovery

Janne Grunau j at jannau.net
Mon Aug 29 08:31:27 CEST 2022


Fixes probing of various keyboards with DWC3 as integrated into Apple
silicon SoCs. The problem appears to be requesting more data than the
devices's bMaxPacketSize0 of 8. Older Logitech unifying receivers
(bcdDevice 12.03 or 12.10) are for eaxample affected.

Signed-off-by: Janne Grunau <j at jannau.net>
Tested-by: Thomas Glanzmann <thomas at glanzmann.de>
---
 common/usb.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index 6fcf1e8428e9..48a310e8599d 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -993,10 +993,12 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
 		 *
 		 * At least the DWC2 controller needs to be programmed with
 		 * the number of packets in addition to the number of bytes.
-		 * A request for 64 bytes of data with the maxpacket guessed
-		 * as 64 (above) yields a request for 1 packet.
+		 * Requesting more than 8 bytes causes probing errors on the
+		 * DWC3 controller integrated into Apple silicon SoCs with
+		 * devices with bMaxPacketSize0 of 8. So limit the read request
+		 * to the used size of 8 bytes.
 		 */
-		err = get_descriptor_len(dev, 64, 8);
+		err = get_descriptor_len(dev, 8, 8);
 		if (err)
 			return err;
 	}
-- 
2.35.1



More information about the U-Boot mailing list