Source-Changes-HG archive

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

[src/jmcneill-audiomp3]: src/sys/dev/pci need to hold intr_lock when calling ...



details:   https://anonhg.NetBSD.org/src/rev/ea21cb1386b7
branches:  jmcneill-audiomp3
changeset: 771338:ea21cb1386b7
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Nov 20 11:10:16 2011 +0000

description:
need to hold intr_lock when calling audio_pint/audio_rint

diffstat:

 sys/dev/pci/gcscaudio.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r dc4f6e4e6186 -r ea21cb1386b7 sys/dev/pci/gcscaudio.c
--- a/sys/dev/pci/gcscaudio.c   Sun Nov 20 11:09:25 2011 +0000
+++ b/sys/dev/pci/gcscaudio.c   Sun Nov 20 11:10:16 2011 +0000
@@ -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 <ryo%nerv.org@localhost>
@@ -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 @@
 
        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 @@
                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;
 }
 



Home | Main Index | Thread Index | Old Index