From d66430ec52ad6e56fce9c89ef30e5e13f4e69d7d Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 7 Jan 2022 21:45:22 -0500 Subject: [PATCH] XHCI: Add missing set-address delay. The USB < 3.0 init code has this, and the XHCI spec indicates that software is responsible for dealing with this still, indeed. Noticed by rudolfc when testing some USB audio devices in #1045. --- src/add-ons/kernel/busses/usb/xhci.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp b/src/add-ons/kernel/busses/usb/xhci.cpp index b74337a608..6f22d2f17d 100644 --- a/src/add-ons/kernel/busses/usb/xhci.cpp +++ b/src/add-ons/kernel/busses/usb/xhci.cpp @@ -1532,6 +1532,9 @@ XHCI::AllocateDevice(Hub *parent, int8 hubAddress, uint8 hubPort, ENDPOINT_0_STATE_GET(_ReadContext( &device->device_ctx->endpoints[0].dwendpoint0))); + // Wait a bit for the device to complete addressing + snooze(USB_DELAY_SET_ADDRESS); + // Create a temporary pipe with the new address ControlPipe pipe(parent); pipe.SetControllerCookie(endpoint0);