From: Matthew Dillon Date: Fri, 10 Jun 2005 18:21:11 +0000 (+0000) Subject: Attempt to avoid a livelocked USB interrupt during boot by not enabling X-Git-Tag: v2.0.1~7062 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/b7736b619f2352bdebee9f542cfe78883e76f680 Attempt to avoid a livelocked USB interrupt during boot by not enabling the EHCI interrupt until after all the companion controllers have been attached. --- diff --git a/sys/bus/usb/ehci.c b/sys/bus/usb/ehci.c index 5268527c92..bfe67ef68c 100644 --- a/sys/bus/usb/ehci.c +++ b/sys/bus/usb/ehci.c @@ -1,7 +1,7 @@ /* * $NetBSD: ehci.c,v 1.67 2004/07/06 04:18:05 mycroft Exp $ * $FreeBSD: src/sys/dev/usb/ehci.c,v 1.5 2003/11/10 00:20:52 joe Exp $ - * $DragonFly: src/sys/bus/usb/ehci.c,v 1.7 2005/06/02 20:40:40 dillon Exp $ + * $DragonFly: src/sys/bus/usb/ehci.c,v 1.8 2005/06/10 18:21:11 dillon Exp $ */ /* @@ -379,6 +379,7 @@ ehci_init(ehci_softc_t *sc) sc->sc_bus.usbrev = USBREV_2_0; /* Reset the controller */ + EOWRITE4(sc, EHCI_USBINTR, 0); /* disable interrupts */ DPRINTF(("%s: resetting\n", USBDEVNAME(sc->sc_bus.bdev))); EOWRITE4(sc, EHCI_USBCMD, 0); /* Halt controller */ usb_delay_ms(&sc->sc_bus, 1); @@ -451,9 +452,6 @@ ehci_init(ehci_softc_t *sc) lockinit(&sc->sc_doorbell_lock, 0, "ehcidb", 0, 0); - /* Enable interrupts */ - EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); - /* Turn on controller */ EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_ITC_8 | /* 8 microframes */ @@ -487,6 +485,13 @@ ehci_init(ehci_softc_t *sc) return (err); } +void +ehci_init_intrs(ehci_softc_t *sc) +{ + /* Enable interrupts */ + EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); +} + int ehci_intr(void *v) { diff --git a/sys/bus/usb/ehci_pci.c b/sys/bus/usb/ehci_pci.c index f41d5b5eba..6810e17acc 100644 --- a/sys/bus/usb/ehci_pci.c +++ b/sys/bus/usb/ehci_pci.c @@ -34,7 +34,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * $FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.9 2003/12/17 17:15:41 peter Exp $ - * $DragonFly: src/sys/bus/usb/ehci_pci.c,v 1.6 2005/05/24 20:58:54 dillon Exp $ + * $DragonFly: src/sys/bus/usb/ehci_pci.c,v 1.7 2005/06/10 18:21:11 dillon Exp $ */ /* @@ -279,6 +279,7 @@ ehci_pci_attach(device_t self) #endif return EIO; } + ehci_init_intrs(sc); return 0; } diff --git a/sys/bus/usb/ehcivar.h b/sys/bus/usb/ehcivar.h index 50d6b95b7f..f0559fba17 100644 --- a/sys/bus/usb/ehcivar.h +++ b/sys/bus/usb/ehcivar.h @@ -1,7 +1,7 @@ /* * $NetBSD: ehcivar.h,v 1.12 2001/12/31 12:16:57 augustss Exp $ * $FreeBSD: src/sys/dev/usb/ehcivar.h,v 1.1 2003/04/14 14:04:07 ticso Exp $ - * $DragonFly: src/sys/bus/usb/ehcivar.h,v 1.2 2004/02/11 15:17:26 joerg Exp $ + * $DragonFly: src/sys/bus/usb/ehcivar.h,v 1.3 2005/06/10 18:21:11 dillon Exp $ */ /* @@ -146,6 +146,7 @@ typedef struct ehci_softc { #define EOWRITE4(sc, a, x) bus_space_write_4((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x)) usbd_status ehci_init(ehci_softc_t *); +void ehci_init_intrs(ehci_softc_t *); int ehci_intr(void *); #if defined(__NetBSD__) || defined(__OpenBSD__) int ehci_detach(ehci_softc_t *, int);