From 401c1d2805915e29445e01bf1264dc1ff3790e87 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 26 Aug 2022 00:01:15 +0200 Subject: [PATCH] usb: request on 8 bytes for USB_SPEED_FULL bMaxPacketSize0 probing Fixes probing of Logitech Unifying receivers (bcdDevice 12.03 or 12.10) with bMaxPacketSize0 == 8 on Apple silicon SoCs using DWC3 controllers. Signed-off-by: Janne Grunau X-tested-by: Thomas Glanzmann Rebased by Thomas Glanzmann because it did not apply using git am --- common/usb.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/usb.c b/common/usb.c index aad13fd9c5..07fedf6be0 100644 --- a/common/usb.c +++ b/common/usb.c @@ -999,8 +999,17 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read) * 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. + * + * The DWC3 controller integrated into Apple silicon SoCs like + * the M1 and M2 does not like to read 64 bytes for devices with + * bMaxPacketSize0 == 8. request only 8 bytes which should also + * result in a single packet. + * Fixes probing errors with Logitech Unifying receivers with + * bcdDevice 12.03 or 12.10. + * A delay of 1 ms after this get_descriptor_len() call fixes + * the issue as well. */ - err = get_descriptor_len(dev, 64, 8); + err = get_descriptor_len(dev, 8, 8); if (err) return err; } -- 2.35.1