Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Drop sc_lock whilst doing uaudio_chan_open uaudi...



details:   https://anonhg.NetBSD.org/src/rev/0e0175345671
branches:  trunk
changeset: 353666:0e0175345671
user:      nat <nat%NetBSD.org@localhost>
date:      Tue May 16 23:49:43 2017 +0000

description:
Drop sc_lock whilst doing uaudio_chan_open uaudio[pr]transfer.
uaudio now works again.

diffstat:

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

diffs (50 lines):

diff -r 38b17aa65da7 -r 0e0175345671 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Tue May 16 23:21:53 2017 +0000
+++ b/sys/dev/usb/uaudio.c      Tue May 16 23:49:43 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uaudio.c,v 1.147 2016/07/07 06:55:42 msaitoh Exp $     */
+/*     $NetBSD: uaudio.c,v 1.148 2017/05/16 23:49:43 nat 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.147 2016/07/07 06:55:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.148 2017/05/16 23:49:43 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2600,6 +2600,7 @@
                    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_intr_lock);
@@ -2622,6 +2623,7 @@
                uaudio_chan_rtransfer(ch);
        }
 
+       mutex_enter(&sc->sc_lock);
        mutex_enter(&sc->sc_intr_lock);
 
        return 0;
@@ -2650,6 +2652,7 @@
                    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_intr_lock);
@@ -2669,6 +2672,7 @@
        /* XXX -1 shouldn't be needed */
        for (i = 0; i < UAUDIO_NCHANBUFS - 1; 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