Drop sc_lock whilst doing uaudio_chan_open uaudio[pr]transfer.

uaudio now works again.
This commit is contained in:
nat 2017-05-16 23:49:43 +00:00
parent 188f75011d
commit 4d77645be1

View File

@ -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 @@ uaudio_trigger_input(void *addr, void *start, void *end, int blksize,
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_trigger_input(void *addr, void *start, void *end, int blksize,
uaudio_chan_rtransfer(ch);
}
mutex_enter(&sc->sc_lock);
mutex_enter(&sc->sc_intr_lock);
return 0;
@ -2650,6 +2652,7 @@ uaudio_trigger_output(void *addr, void *start, void *end, int blksize,
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 @@ uaudio_trigger_output(void *addr, void *start, void *end, int blksize,
/* 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;