[PATCH 1/5] usb: hub: wait after port reset recovery

Ahmad Fatoum <[email protected]> Fri, 26 Jun 2026 19:31:37 +0200
Newsgroups org.infradead.lists.barebox
Message-ID <[email protected]>
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 <[email protected]>
|   Reviewed-by: Marek Vasut <[email protected]>

Assisted-by: Codex:gpt-5.5
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 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