Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb If the SMM driver had enabled ownership change i...



details:   https://anonhg.NetBSD.org/src/rev/90b8ceeb2a35
branches:  trunk
changeset: 580594:90b8ceeb2a35
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sun May 01 00:45:55 2005 +0000

description:
If the SMM driver had enabled ownership change interrupts, re-enable them
temporarily before we attempt to take control.

>From OpenBSD.

diffstat:

 sys/dev/usb/ohci.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r bd13eeb8da3e -r 90b8ceeb2a35 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Sun May 01 00:37:10 2005 +0000
+++ b/sys/dev/usb/ohci.c        Sun May 01 00:45:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.159 2005/04/30 14:38:40 augustss Exp $      */
+/*     $NetBSD: ohci.c,v 1.160 2005/05/01 00:45:55 augustss Exp $      */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.159 2005/04/30 14:38:40 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.160 2005/05/01 00:45:55 augustss Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -763,12 +763,16 @@
        if (ctl & OHCI_IR) {
                /* SMM active, request change */
                DPRINTF(("ohci_init: SMM active, request owner change\n"));
+               if ((sc->sc_intre & (OHCI_OC | OHCI_MIE)) ==
+                   (OHCI_OC | OHCI_MIE))
+                       OWRITE4(sc, OHCI_INTERRUPT_ENABLE, OHCI_MIE);
                s = OREAD4(sc, OHCI_COMMAND_STATUS);
                OWRITE4(sc, OHCI_COMMAND_STATUS, s | OHCI_OCR);
                for (i = 0; i < 100 && (ctl & OHCI_IR); i++) {
                        usb_delay_ms(&sc->sc_bus, 1);
                        ctl = OREAD4(sc, OHCI_CONTROL);
                }
+               OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_MIE);
                if ((ctl & OHCI_IR) == 0) {
                        printf("%s: SMM does not respond, resetting\n",
                               USBDEVNAME(sc->sc_bus.bdev));



Home | Main Index | Thread Index | Old Index