Tue Dec 13 12:26:32 2011 UTC ()
- 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.


(mrg)
diff -r1.256 -r1.257 src/sys/dev/audio.c
diff -r1.125 -r1.126 src/sys/dev/usb/uaudio.c

cvs diff -r1.256 -r1.257 src/sys/dev/Attic/audio.c (expand / switch to context diff)
--- src/sys/dev/Attic/audio.c 2011/12/09 05:08:25 1.256
+++ src/sys/dev/Attic/audio.c 2011/12/13 12:26:32 1.257
@@ -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;

cvs diff -r1.125 -r1.126 src/sys/dev/usb/uaudio.c (expand / switch to context diff)
--- src/sys/dev/usb/uaudio.c 2011/12/09 05:03:18 1.125
+++ src/sys/dev/usb/uaudio.c 2011/12/13 12:26:32 1.126
@@ -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);
 }