From: mikeb Date: Wed, 27 May 2015 11:13:34 +0000 (+0000) Subject: Improve the controller state check in xhci_reset X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9e16ec652a8805fa9f2f1fc730b19cce43f9d918;p=openbsd Improve the controller state check in xhci_reset From FreeBSD, OK mpi --- 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; }