Module Name:    src
Committed By:   jmcneill
Date:           Sun Nov 20 11:10:16 UTC 2011

Modified Files:
        src/sys/dev/pci [jmcneill-audiomp3]: gcscaudio.c

Log Message:
need to hold intr_lock when calling audio_pint/audio_rint


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/dev/pci/gcscaudio.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/pci/gcscaudio.c
diff -u src/sys/dev/pci/gcscaudio.c:1.7.4.2 src/sys/dev/pci/gcscaudio.c:1.7.4.3
--- src/sys/dev/pci/gcscaudio.c:1.7.4.2	Sat Nov 19 23:36:38 2011
+++ src/sys/dev/pci/gcscaudio.c	Sun Nov 20 11:10:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gcscaudio.c,v 1.7.4.2 2011/11/19 23:36:38 jmcneill Exp $	*/
+/*	$NetBSD: gcscaudio.c,v 1.7.4.3 2011/11/20 11:10:16 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 SHIMIZU Ryo <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.7.4.2 2011/11/19 23:36:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.7.4.3 2011/11/20 11:10:16 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1210,9 +1210,12 @@ gcscaudio_intr(void *arg)
 
 	nintr = 0;
 	sc = (struct gcscaudio_softc *)arg;
+
+	mutex_spin_enter(&sc->sc_intr_lock);
+
 	intr = bus_space_read_2(sc->sc_iot, sc->sc_ioh, ACC_IRQ_STATUS);
 	if (intr == 0)
-		return 0;
+		goto done;
 
 	/* Front output */
 	if (intr & ACC_IRQ_STATUS_BM0_IRQ_STS) {
@@ -1289,6 +1292,9 @@ gcscaudio_intr(void *arg)
 		aprint_normal_dev(&sc->sc_dev, "Audio Bus Master 5 IRQ Status\n");
 #endif
 
+done:
+	mutex_spin_exit(&sc->sc_intr_lock);
+
 	return nintr ? 1 : 0;
 }
 

Reply via email to