From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CE3DECAAD2 for ; Mon, 29 Aug 2022 07:07:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A3848458A; Mon, 29 Aug 2022 09:07:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C8D27841D7; Mon, 29 Aug 2022 09:07:44 +0200 (CEST) Received: from sibelius.xs4all.nl (80-61-163-207.fixed.kpn.net [80.61.163.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3B70183BAC for ; Mon, 29 Aug 2022 09:07:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=mark.kettenis@xs4all.nl Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id aca77574; Mon, 29 Aug 2022 09:07:39 +0200 (CEST) Date: Mon, 29 Aug 2022 09:07:39 +0200 (CEST) From: Mark Kettenis To: Janne Grunau Cc: u-boot@lists.denx.de, marex@denx.de, thomas@glanzmann.de In-Reply-To: <20220829063127.30353-1-j@jannau.net> (message from Janne Grunau on Mon, 29 Aug 2022 08:31:27 +0200) Subject: Re: [PATCH 1/1] usb: request only 8 bytes for USB_SPEED_FULL bMaxPacketSize0 discovery References: <20220829063127.30353-1-j@jannau.net> Message-ID: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean > From: Janne Grunau > Date: Mon, 29 Aug 2022 08:31:27 +0200 > > 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. I somehow suspect this is a more general issue that doesn't really depend on the particular USB host controller that is in use, but rather on the particular USB device. Would be interesting if someone could test this on other hardware. Probably the easiest way to fix this is to find a keyboard that currently doesn't work with u-boot and see whether this fixes it when used on something like a Raspberry Pi 4 (which has a PCI XHCI controller). Don't think this should hold up this fix though. > Signed-off-by: Janne Grunau > Tested-by: Thomas Glanzmann > --- > 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 > >