Module Name:    src
Committed By:   jmcneill
Date:           Wed Jan 23 03:32:39 UTC 2013

Modified Files:
        src/sys/dev/usb: dwc_otg.c

Log Message:
dwc_otg_timer: need to hold intr lock when accessing sc_active queue


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/usb/dwc_otg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/dwc_otg.c
diff -u src/sys/dev/usb/dwc_otg.c:1.37 src/sys/dev/usb/dwc_otg.c:1.38
--- src/sys/dev/usb/dwc_otg.c:1.37	Tue Jan 22 21:59:52 2013
+++ src/sys/dev/usb/dwc_otg.c	Wed Jan 23 03:32:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc_otg.c,v 1.37 2013/01/22 21:59:52 jmcneill Exp $	*/
+/*	$NetBSD: dwc_otg.c,v 1.38 2013/01/23 03:32:39 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.37 2013/01/22 21:59:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.38 2013/01/23 03:32:39 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3192,14 +3192,13 @@ dwc_otg_timer(struct dwc_otg_softc *sc)
 	/* increment timer value */
 	sc->sc_tmr_val++;
 
+	mutex_spin_enter(&sc->sc_intr_lock);
 	TAILQ_FOREACH(xfer, &sc->sc_active, xnext) {
 		td = xfer->td_transfer_cache;
 		if (td != NULL)
 			td->did_nak = 0;
 	}
-
 	/* poll jobs */
-	mutex_spin_enter(&sc->sc_intr_lock);
 	dwc_otg_interrupt_poll(sc);
 	mutex_spin_exit(&sc->sc_intr_lock);
 

Reply via email to