Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/sunxi Take the interrupt lock in interrupt hand...



details:   https://anonhg.NetBSD.org/src/rev/78f541436a07
branches:  trunk
changeset: 831911:78f541436a07
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Apr 19 18:19:17 2018 +0000

description:
Take the interrupt lock in interrupt handler. Seesm to fix the hang I was
seeing with a portaudio2 application.
Don't unmute at attach time, it will be done when the upper level starts
sending data.

diffstat:

 sys/arch/arm/sunxi/sunxi_codec.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r c84d380304ff -r 78f541436a07 sys/arch/arm/sunxi/sunxi_codec.c
--- a/sys/arch/arm/sunxi/sunxi_codec.c  Thu Apr 19 08:39:18 2018 +0000
+++ b/sys/arch/arm/sunxi/sunxi_codec.c  Thu Apr 19 18:19:17 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_codec.c,v 1.3 2017/10/07 21:53:16 jmcneill Exp $ */
+/* $NetBSD: sunxi_codec.c,v 1.4 2018/04/19 18:19:17 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.3 2017/10/07 21:53:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.4 2018/04/19 18:19:17 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -550,7 +550,9 @@
 sunxi_codec_dmaintr(void *priv)
 {
        struct sunxi_codec_chan * const ch = priv;
+       struct sunxi_codec_softc * const sc = ch->ch_sc;
 
+       mutex_enter(&sc->sc_intr_lock);
        ch->ch_cur_phys += ch->ch_blksize;
        if (ch->ch_cur_phys >= ch->ch_end_phys)
                ch->ch_cur_phys = ch->ch_start_phys;
@@ -559,6 +561,7 @@
                ch->ch_intr(ch->ch_intrarg);
                sunxi_codec_transfer(ch);
        }
+       mutex_exit(&sc->sc_intr_lock);
 }
 
 static int
@@ -688,8 +691,6 @@
 
        /* Optional PA mute GPIO */
        sc->sc_pin_pa = fdtbus_gpio_acquire(phandle, "allwinner,pa-gpios", GPIO_PIN_OUTPUT);
-       if (sc->sc_pin_pa != NULL)
-               fdtbus_gpio_write(sc->sc_pin_pa, 1);
 
        aprint_naive("\n");
        aprint_normal(": %s\n", sc->sc_cfg->name);



Home | Main Index | Thread Index | Old Index