summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2015-05-27 11:13:34 +0000
committermikeb <mikeb@openbsd.org>2015-05-27 11:13:34 +0000
commit9e16ec652a8805fa9f2f1fc730b19cce43f9d918 (patch)
tree95551da5f88297c94b6e1f7e221f4a5ad3b48c9e
parentcall exynos_platform_match() if the kernel is compiled with exynos devices (diff)
downloadwireguard-openbsd-9e16ec652a8805fa9f2f1fc730b19cce43f9d918.tar.xz
wireguard-openbsd-9e16ec652a8805fa9f2f1fc730b19cce43f9d918.zip
Improve the controller state check in xhci_reset
From FreeBSD, OK mpi
-rw-r--r--sys/dev/usb/xhci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c
index 69a61595ec3..436bf53e34a 100644
--- a/sys/dev/usb/xhci.c
+++ b/sys/dev/usb/xhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xhci.c,v 1.59 2015/04/19 11:12:58 mpi Exp $ */
+/* $OpenBSD: xhci.c,v 1.60 2015/05/27 11:13:34 mikeb Exp $ */
/*
* Copyright (c) 2014-2015 Martin Pieuchot
@@ -560,7 +560,8 @@ xhci_reset(struct xhci_softc *sc)
XOWRITE4(sc, XHCI_USBCMD, XHCI_CMD_HCRST);
for (i = 0; i < 100; i++) {
usb_delay_ms(&sc->sc_bus, 1);
- hcr = XOREAD4(sc, XHCI_USBCMD) & XHCI_STS_CNR;
+ hcr = (XOREAD4(sc, XHCI_USBCMD) & XHCI_CMD_HCRST) |
+ (XOREAD4(sc, XHCI_USBSTS) & XHCI_STS_CNR);
if (!hcr)
break;
}