All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] usb: request only 8 bytes for USB_SPEED_FULL bMaxPacketSize0 discovery
@ 2022-08-29  6:31 Janne Grunau
  2022-08-29  7:07 ` Mark Kettenis
  2022-09-25 23:52 ` Marek Vasut
  0 siblings, 2 replies; 6+ messages in thread
From: Janne Grunau @ 2022-08-29  6:31 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Thomas Glanzmann

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@jannau.net>
Tested-by: Thomas Glanzmann <thomas@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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-30  2:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29  6:31 [PATCH 1/1] usb: request only 8 bytes for USB_SPEED_FULL bMaxPacketSize0 discovery Janne Grunau
2022-08-29  7:07 ` Mark Kettenis
2022-09-25 23:52 ` Marek Vasut
2022-09-26  5:42   ` Janne Grunau
2022-09-26  7:34   ` Thomas Glanzmann
2022-09-30  2:54     ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.