Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Take the bus lock in ohci_poll as it's assumed b...



details:   https://anonhg.NetBSD.org/src/rev/6befa6c5926c
branches:  trunk
changeset: 785877:6befa6c5926c
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Apr 04 12:21:12 2013 +0000

description:
Take the bus lock in ohci_poll as it's assumed by ohci_softintr which
will get called by ohci_intr1... I can enter ddb using usb keyboard
attached via ohci now.

diffstat:

 sys/dev/usb/ohci.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r dd4b07ebd49e -r 6befa6c5926c sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Thu Apr 04 11:28:02 2013 +0000
+++ b/sys/dev/usb/ohci.c        Thu Apr 04 12:21:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.238 2013/04/04 09:46:42 skrll Exp $ */
+/*     $NetBSD: ohci.c,v 1.239 2013/04/04 12:21:12 skrll Exp $ */
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.238 2013/04/04 09:46:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.239 2013/04/04 12:21:12 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1682,13 +1682,14 @@
                last = new;
        }
 #endif
-
+       mutex_enter(&sc->sc_lock);
        sc->sc_eintrs |= OHCI_WDH;
        if (OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs) {
                mutex_spin_enter(&sc->sc_intr_lock);
                ohci_intr1(sc);
                mutex_spin_exit(&sc->sc_intr_lock);
        }
+       mutex_exit(&sc->sc_lock);
 }
 
 usbd_status



Home | Main Index | Thread Index | Old Index