mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 2/5] usb: wait after initial device descriptor read
Date: Fri, 26 Jun 2026 19:31:38 +0200	[thread overview]
Message-ID: <20260626174342.1923132-3-a.fatoum@barebox.org> (raw)
In-Reply-To: <20260626174342.1923132-1-a.fatoum@barebox.org>

Port over U-Boot commit 3406e9d8afcc8ade8cb3e697be2bcf9cc85c9d04:

|   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 <marex@denx.de>
|   Tested-by: Janne Grunau <j@jannau.net>

Assisted-by: Codex:gpt-5.5
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 drivers/usb/core/usb.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index ae87137447c7..c6b3187de17d 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -403,6 +403,17 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
 		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;
 		dev->epmaxpacketout[0] = dev->descriptor->bMaxPacketSize0;
 	}
-- 
2.47.3




  parent reply	other threads:[~2026-06-26 17:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 17:31 [PATCH 0/5] usb: port over some U-Boot fixes Ahmad Fatoum
2026-06-26 17:31 ` [PATCH 1/5] usb: hub: wait after port reset recovery Ahmad Fatoum
2026-06-26 17:31 ` Ahmad Fatoum [this message]
2026-06-26 17:31 ` [PATCH 3/5] usb: wait after setting device configuration Ahmad Fatoum
2026-06-26 17:31 ` [PATCH 4/5] usb: separate descriptor and config requests Ahmad Fatoum
2026-06-26 17:31 ` [PATCH 5/5] usb: hub: tolerate transient disconnects during reset Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260626174342.1923132-3-a.fatoum@barebox.org \
    --to=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox