Module Name:    src
Committed By:   isaki
Date:           Wed May  1 13:09:34 UTC 2019

Modified Files:
        src/sys/dev/usb [isaki-audio2]: uaudio.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.158.2.1 -r1.158.2.2 src/sys/dev/usb/uaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.158.2.1 src/sys/dev/usb/uaudio.c:1.158.2.2
--- src/sys/dev/usb/uaudio.c:1.158.2.1	Wed May  1 12:42:14 2019
+++ src/sys/dev/usb/uaudio.c	Wed May  1 13:09:33 2019
@@ -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 @@ uaudio_trigger_input(void *addr, void *s
 		    "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_trigger_input(void *addr, void *s
 		uaudio_chan_rtransfer(ch);
 	}
 
-	mutex_enter(&sc->sc_lock);
-	mutex_enter(&sc->sc_intr_lock);
-
 	return 0;
 }
 
@@ -2592,20 +2583,14 @@ uaudio_trigger_output(void *addr, void *
 		    "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 @@ uaudio_trigger_output(void *addr, void *
 
 	for (i = 0; i < UAUDIO_NCHANBUFS; i++)
 		uaudio_chan_ptransfer(ch);
-	mutex_enter(&sc->sc_lock);
-	mutex_enter(&sc->sc_intr_lock);
 
 	return 0;
 }

Reply via email to