From: weitaowang-oc@zhaoxin.com Date: Sun, 9 Aug 2020 14:22:23 +0000 (+0000) Subject: USB:Fix xHCI initail fail by using longer reset and CNR clear timeout value X-Git-Tag: rel-1.15.0~25 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=849c5e50b6f474df6cc113130575bcdccfafcd9e;p=seabios.git USB:Fix xHCI initail fail by using longer reset and CNR clear timeout value Some xHCI controller's reset time than 100ms,such as 120ms. On the on hand, xHCI spec has not specified a timeout value. Maybe setting xHCI HCRST and CNR bit clear timeout value larger is a nice thing.As a compromise between compatibility and latency,we can take 1000ms as a timeout value. Signed-off-by: WeitaoWangoc Message-Id: <159698294308.14.13067234241650533818@b63950293ec5> --- diff --git a/src/hw/usb-xhci.c b/src/hw/usb-xhci.c index 08d1e32..21d091f 100644 --- a/src/hw/usb-xhci.c +++ b/src/hw/usb-xhci.c @@ -467,9 +467,9 @@ configure_xhci(void *data) dprintf(3, "%s: resetting\n", __func__); writel(&xhci->op->usbcmd, XHCI_CMD_HCRST); - if (wait_bit(&xhci->op->usbcmd, XHCI_CMD_HCRST, 0, 100) != 0) + if (wait_bit(&xhci->op->usbcmd, XHCI_CMD_HCRST, 0, 1000) != 0) goto fail; - if (wait_bit(&xhci->op->usbsts, XHCI_STS_CNR, 0, 100) != 0) + if (wait_bit(&xhci->op->usbsts, XHCI_STS_CNR, 0, 1000) != 0) goto fail; writel(&xhci->op->config, xhci->slots);