Source-Changes-HG archive

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

[src/trunk]: src/sys/dev - convert the audio softintr's to SOFTINT_SERIAL. r...



details:   https://anonhg.NetBSD.org/src/rev/d2b7ff2ebe22
branches:  trunk
changeset: 772005:d2b7ff2ebe22
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Dec 13 12:26:32 2011 +0000

description:
- convert the audio softintr's to SOFTINT_SERIAL.  right now they're on
  the same priority level as USB and if an audio softintr is blocked
  waiting for a usb event, they'll dead lock.  also, audio being higher
  priority is a fine idea.

- revert the previous audio.c changes as they were unsafe and this change
  obviates the need for them.

XXX:  convert the audio softint's to use a high priority thread or a
XXX:  workqueue would be better again.

diffstat:

 sys/dev/audio.c      |  8 ++++----
 sys/dev/usb/uaudio.c |  8 ++------
 2 files changed, 6 insertions(+), 10 deletions(-)

diffs (70 lines):

diff -r 5aa5235bcf1a -r d2b7ff2ebe22 sys/dev/audio.c
--- a/sys/dev/audio.c   Tue Dec 13 12:25:42 2011 +0000
+++ b/sys/dev/audio.c   Tue Dec 13 12:26:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.256 2011/12/09 05:08:25 mrg Exp $  */
+/*     $NetBSD: audio.c,v 1.257 2011/12/13 12:26:32 mrg Exp $  */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.256 2011/12/09 05:08:25 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.257 2011/12/13 12:26:32 mrg Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -492,9 +492,9 @@
                return;
        }
 
-       sc->sc_sih_rd = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+       sc->sc_sih_rd = softint_establish(SOFTINT_SERIAL | SOFTINT_MPSAFE,
            audio_softintr_rd, sc);
-       sc->sc_sih_wr = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+       sc->sc_sih_wr = softint_establish(SOFTINT_SERIAL | SOFTINT_MPSAFE,
            audio_softintr_wr, sc);
 
        iclass = mclass = oclass = rclass = -1;
diff -r 5aa5235bcf1a -r d2b7ff2ebe22 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Tue Dec 13 12:25:42 2011 +0000
+++ b/sys/dev/usb/uaudio.c      Tue Dec 13 12:26:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uaudio.c,v 1.125 2011/12/09 05:03:18 mrg Exp $ */
+/*     $NetBSD: uaudio.c,v 1.126 2011/12/13 12:26:32 mrg Exp $ */
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.125 2011/12/09 05:03:18 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.126 2011/12/13 12:26:32 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2465,10 +2465,8 @@
 
        DPRINTFN(5,"which=%d chan=%d\n", which, chan);
        KERNEL_LOCK(1, curlwp);
-       mutex_exit(&sc->sc_lock);
        val = uaudio_get(sc, which, UT_READ_CLASS_INTERFACE, mc->wValue[chan],
                         mc->wIndex, MIX_SIZE(mc->type));
-       mutex_enter(&sc->sc_lock);
        KERNEL_UNLOCK_ONE(curlwp);
        return uaudio_value2bsd(mc, val);
 }
@@ -2480,10 +2478,8 @@
 
        val = uaudio_bsd2value(mc, val);
        KERNEL_LOCK(1, curlwp);
-       mutex_exit(&sc->sc_lock);
        uaudio_set(sc, which, UT_WRITE_CLASS_INTERFACE, mc->wValue[chan],
                   mc->wIndex, MIX_SIZE(mc->type), val);
-       mutex_enter(&sc->sc_lock);
        KERNEL_UNLOCK_ONE(curlwp);
 }
 



Home | Main Index | Thread Index | Old Index