Source-Changes-HG archive

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

[src/isaki-audio2]: src/sys/dev/usb Don't release sc_lock and sc_intr_lock in...



details:   https://anonhg.NetBSD.org/src/rev/ee47ff5ad362
branches:  isaki-audio2
changeset: 450966:ee47ff5ad362
user:      isaki <isaki%NetBSD.org@localhost>
date:      Wed May 01 13:09:33 2019 +0000

description:
Don't release sc_lock and sc_intr_lock in trigger_{input,output}.
In the past, sc_lock was IPL_SCHED and (probably) it had conflicted
with usb subroutines.  But at some point, sc_lock has changed to use
IPL_SOFTUSB so such problems should been gone.

diffstat:

 sys/dev/usb/uaudio.c |  21 ++-------------------
 1 files changed, 2 insertions(+), 19 deletions(-)

diffs (79 lines):

diff -r 13f00d6f4149 -r ee47ff5ad362 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Wed May 01 12:42:14 2019 +0000
+++ b/sys/dev/usb/uaudio.c      Wed May 01 13:09:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uaudio.c,v 1.158.2.1 2019/05/01 12:42:14 isaki Exp $   */
+/*     $NetBSD: uaudio.c,v 1.158.2.2 2019/05/01 13:09:33 isaki Exp $   */
 
 /*
  * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.158.2.1 2019/05/01 12:42:14 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.158.2.2 2019/05/01 13:09:33 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2535,20 +2535,14 @@
                    "fraction=0.%03d\n", ch->sample_size, ch->bytes_per_frame,
                    ch->fraction);
 
-       mutex_exit(&sc->sc_intr_lock);
-       mutex_exit(&sc->sc_lock);
        err = uaudio_chan_open(sc, ch);
        if (err) {
-               mutex_enter(&sc->sc_lock);
-               mutex_enter(&sc->sc_intr_lock);
                return EIO;
        }
 
        err = uaudio_chan_alloc_buffers(sc, ch);
        if (err) {
                uaudio_chan_close(sc, ch);
-               mutex_enter(&sc->sc_lock);
-               mutex_enter(&sc->sc_intr_lock);
                return EIO;
        }
 
@@ -2564,9 +2558,6 @@
                uaudio_chan_rtransfer(ch);
        }
 
-       mutex_enter(&sc->sc_lock);
-       mutex_enter(&sc->sc_intr_lock);
-
        return 0;
 }
 
@@ -2592,20 +2583,14 @@
                    "fraction=0.%03d\n", ch->sample_size, ch->bytes_per_frame,
                    ch->fraction);
 
-       mutex_exit(&sc->sc_intr_lock);
-       mutex_exit(&sc->sc_lock);
        err = uaudio_chan_open(sc, ch);
        if (err) {
-               mutex_enter(&sc->sc_lock);
-               mutex_enter(&sc->sc_intr_lock);
                return EIO;
        }
 
        err = uaudio_chan_alloc_buffers(sc, ch);
        if (err) {
                uaudio_chan_close(sc, ch);
-               mutex_enter(&sc->sc_lock);
-               mutex_enter(&sc->sc_intr_lock);
                return EIO;
        }
 
@@ -2614,8 +2599,6 @@
 
        for (i = 0; i < UAUDIO_NCHANBUFS; i++)
                uaudio_chan_ptransfer(ch);
-       mutex_enter(&sc->sc_lock);
-       mutex_enter(&sc->sc_intr_lock);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index