Source-Changes-HG archive

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

[src/jmcneill-usbmp]: src/sys/dev pullup audio.c 1.261: audio_clear() locking...



details:   https://anonhg.NetBSD.org/src/rev/7936100fcc49
branches:  jmcneill-usbmp
changeset: 771848:7936100fcc49
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Apr 30 02:42:32 2012 +0000

description:
pullup audio.c 1.261: audio_clear() locking fixes

diffstat:

 sys/dev/audio.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 04f2434f4d99 -r 7936100fcc49 sys/dev/audio.c
--- a/sys/dev/audio.c   Mon Apr 30 02:41:02 2012 +0000
+++ b/sys/dev/audio.c   Mon Apr 30 02:42:32 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.255.2.4 2012/04/29 23:04:47 mrg Exp $      */
+/*     $NetBSD: audio.c,v 1.255.2.5 2012/04/30 02:42: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.255.2.4 2012/04/29 23:04:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.255.2.5 2012/04/30 02:42:32 mrg Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -1991,7 +1991,7 @@
 audio_clear(struct audio_softc *sc)
 {
 
-       KASSERT(mutex_owned(sc->sc_lock));
+       KASSERT(mutex_owned(sc->sc_intr_lock));
 
        if (sc->sc_rbus) {
                cv_broadcast(&sc->sc_rchan);
@@ -2387,8 +2387,8 @@
                DPRINTF(("AUDIO_FLUSH\n"));
                rbus = sc->sc_rbus;
                pbus = sc->sc_pbus;
+               mutex_enter(sc->sc_intr_lock);
                audio_clear(sc);
-               mutex_enter(sc->sc_intr_lock);
                error = audio_initbufs(sc);
                if (error) {
                        mutex_exit(sc->sc_intr_lock);



Home | Main Index | Thread Index | Old Index