Module Name: src
Committed By: mrg
Date: Tue Dec 13 12:26:32 UTC 2011
Modified Files:
src/sys/dev: audio.c
src/sys/dev/usb: uaudio.c
Log Message:
- 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.
To generate a diff of this commit:
cvs rdiff -u -r1.256 -r1.257 src/sys/dev/audio.c
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/usb/uaudio.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/audio.c
diff -u src/sys/dev/audio.c:1.256 src/sys/dev/audio.c:1.257
--- src/sys/dev/audio.c:1.256 Fri Dec 9 05:08:25 2011
+++ src/sys/dev/audio.c Tue Dec 13 12:26:32 2011
@@ -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 @@ audioattach(device_t parent, device_t se
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;
Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.125 src/sys/dev/usb/uaudio.c:1.126
--- src/sys/dev/usb/uaudio.c:1.125 Fri Dec 9 05:03:18 2011
+++ src/sys/dev/usb/uaudio.c Tue Dec 13 12:26:32 2011
@@ -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 @@ uaudio_ctl_get(struct uaudio_softc *sc,
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 @@ uaudio_ctl_set(struct uaudio_softc *sc,
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);
}