Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/audio audio(9): Issue pserialize_perform outside sc_...



details:   https://anonhg.NetBSD.org/src/rev/abb1abe3b749
branches:  trunk
changeset: 1024113:abb1abe3b749
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Oct 10 11:21:05 2021 +0000

description:
audio(9): Issue pserialize_perform outside sc_lock in audiodetach.

Breaks another deadlock between sc_lock and high-priority xcalls at
softint serial.  With any luck, this should be the last such softint
deadlock in audio!

diffstat:

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

diffs (34 lines):

diff -r 3df0d5ab6262 -r abb1abe3b749 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Sun Oct 10 11:20:46 2021 +0000
+++ b/sys/dev/audio/audio.c     Sun Oct 10 11:21:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.109 2021/10/10 11:20:29 riastradh Exp $    */
+/*     $NetBSD: audio.c,v 1.110 2021/10/10 11:21:05 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.109 2021/10/10 11:20:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.110 2021/10/10 11:21:05 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1322,6 +1322,7 @@
        SLIST_FOREACH(file, &sc->sc_files, entry) {
                atomic_store_relaxed(&file->dying, true);
        }
+       mutex_exit(sc->sc_lock);
 
        /*
         * Wait for existing users to drain.
@@ -1331,7 +1332,6 @@
         *   be psref_released.
         */
        pserialize_perform(sc->sc_psz);
-       mutex_exit(sc->sc_lock);
        psref_target_destroy(&sc->sc_psref, audio_psref_class);
 
        /*



Home | Main Index | Thread Index | Old Index