From 4d77645be1ec471f9cb5b0611e31c961cdcba098 Mon Sep 17 00:00:00 2001 From: nat Date: Tue, 16 May 2017 23:49:43 +0000 Subject: [PATCH] Drop sc_lock whilst doing uaudio_chan_open uaudio[pr]transfer. uaudio now works again. --- sys/dev/usb/uaudio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 6b71f3043366..b5730730658a 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -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 -__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;