Source-Changes-HG archive

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

[src/trunk]: src/sys/dev take interrupt lock when closing backend.



details:   https://anonhg.NetBSD.org/src/rev/6113deea54eb
branches:  trunk
changeset: 450984:6113deea54eb
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu May 02 09:19:28 2019 +0000

description:
take interrupt lock when closing backend.

diffstat:

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

diffs (31 lines):

diff -r 81350f299d18 -r 6113deea54eb sys/dev/audio.c
--- a/sys/dev/audio.c   Thu May 02 02:51:01 2019 +0000
+++ b/sys/dev/audio.c   Thu May 02 09:19:28 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.459 2019/02/27 02:27:38 mrg Exp $  */
+/*     $NetBSD: audio.c,v 1.460 2019/05/02 09:19:28 mlelstv Exp $      */
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.459 2019/02/27 02:27:38 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.460 2019/05/02 09:19:28 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2366,8 +2366,11 @@
 bad:
        audio_destroy_pfilters(vc);
        audio_destroy_rfilters(vc);
-       if (hw->close != NULL && sc->sc_opens == 0 && sc->sc_recopens == 0)
+       if (hw->close != NULL && sc->sc_opens == 0 && sc->sc_recopens == 0) {
+               mutex_enter(sc->sc_intr_lock);
                hw->close(sc->hw_hdl);
+               mutex_exit(sc->sc_intr_lock);
+       }
        mutex_exit(sc->sc_lock);
        if (sc->sc_usemixer) {
                audio_free_ring(sc, &vc->sc_mpr);



Home | Main Index | Thread Index | Old Index