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 1/5] usb: hub: wait after port reset recovery
Date: Fri, 26 Jun 2026 19:31:37 +0200	[thread overview]
Message-ID: <20260626174342.1923132-2-a.fatoum@barebox.org> (raw)
In-Reply-To: <20260626174342.1923132-1-a.fatoum@barebox.org>

Port over U-Boot commit b5999f8f6ca89223b70ec3038fcfe9dbb6c67475:

|   usb: hub: Add missing reset recovery delay
|
|   Some devices like YubiKeys need more time before SET_ADDRESS. The spec
|   says we need to wait 10ms.
|
|   Signed-off-by: Hector Martin <marcan@marcan.st>
|   Reviewed-by: Marek Vasut <marex@denx.de>

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

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 70da8566b289..e969fc466a8e 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -282,6 +282,13 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port,
 		return;
 	}
 
+	/*
+	 * USB 2.0 7.1.7.5: devices must be able to accept a SetAddress()
+	 * request (refer to Section 11.24.2 and Section 9.4 respectively)
+	 * after the reset recovery time 10 ms
+	 */
+	mdelay(10);
+
 	dev->children[port] = usb;
 	usb->parent = dev;
 	usb->portnr = port + 1;
-- 
2.47.3




  reply	other threads:[~2026-06-26 18:15 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 ` Ahmad Fatoum [this message]
2026-06-26 17:31 ` [PATCH 2/5] usb: wait after initial device descriptor read Ahmad Fatoum
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-2-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