Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/audio Add KASSERTs. audio_[pr]mixer_start() need ex...



details:   https://anonhg.NetBSD.org/src/rev/1e097090d66b
branches:  trunk
changeset: 745050:1e097090d66b
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Feb 22 08:01:59 2020 +0000

description:
Add KASSERTs.  audio_[pr]mixer_start() need exlock.

diffstat:

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

diffs (52 lines):

diff -r a6ec0c65a477 -r 1e097090d66b sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Sat Feb 22 07:59:47 2020 +0000
+++ b/sys/dev/audio/audio.c     Sat Feb 22 08:01:59 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.49 2020/02/22 07:59:47 isaki Exp $ */
+/*     $NetBSD: audio.c,v 1.50 2020/02/22 08:01:59 isaki Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.49 2020/02/22 07:59:47 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.50 2020/02/22 08:01:59 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -4788,7 +4788,7 @@
 /*
  * Starts playback mixer.
  * Must be called only if sc_pbusy is false.
- * Must be called with sc_lock held.
+ * Must be called with sc_lock && sc_exlock held.
  * Must not be called from the interrupt context.
  */
 static void
@@ -4798,6 +4798,7 @@
        int minimum;
 
        KASSERT(mutex_owned(sc->sc_lock));
+       KASSERT(sc->sc_exlock);
        KASSERT(sc->sc_pbusy == false);
 
        mutex_enter(sc->sc_intr_lock);
@@ -5290,7 +5291,7 @@
 /*
  * Starts record mixer.
  * Must be called only if sc_rbusy is false.
- * Must be called with sc_lock held.
+ * Must be called with sc_lock && sc_exlock held.
  * Must not be called from the interrupt context.
  */
 static void
@@ -5298,6 +5299,7 @@
 {
 
        KASSERT(mutex_owned(sc->sc_lock));
+       KASSERT(sc->sc_exlock);
        KASSERT(sc->sc_rbusy == false);
 
        mutex_enter(sc->sc_intr_lock);



Home | Main Index | Thread Index | Old Index