From f8f027f5b53476498f11f7ca8622fbf3c53dbcd8 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 9 Aug 2025 00:04:29 -0400 Subject: kernel: xhci: Wait until xHC is ready in reset Signed-off-by: Ian Moffett --- sys/dev/usb/xhci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 5a8da86..e14cb44 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -340,6 +340,13 @@ xhci_reset(struct xhci_hc *hc) return error; } + /* Wait longer if the xHC is not ready */ + error = xhci_poll32(&opregs->usbsts, USBSTS_CNR, false); + if (error < 0) { + pr_error("xhci_reset: xHC ready wait timeout\n"); + return error; + } + return 0; } -- cgit v1.2.3