[alsa-devel] patch 1/1: ASoC, DMA crash with application- resolved

Jarkko Nikula jhnikula at gmail.com
Sun Dec 21 10:36:39 CET 2008

On Sun, Dec 21, 2008 at 9:22 AM, naveenkrishna. ch <
naveenkrishna.ch at gmail.com> wrote:

> I am using a OMAP3 + TWL4030 combination with ASoC
> in the sound/soc/omap/omap-pcm.c
> DMA channels are being freed after unlinking in the omap_pcm_hw_free
> function
> Which is causing a crash during applications
> So, stopping the DMA channels before unlinking resolves the issue.
> here is the patch that solves the issue
> diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
> index e9084fd..679e384 100644
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -116,6 +116,7 @@ static int omap_pcm_hw_free(struct snd_pcm_substream
> *substream)
>        if (prtd->dma_data == NULL)
>                return 0;
> +       omap_stop_dma(prtd->dma_ch);
>        if (!cpu_is_omap1510())
>                omap_dma_unlink_lch(prtd->dma_ch, prtd->dma_ch);
>        omap_free_dma(prtd->dma_ch);
> Is this ok or is there any better way out
> --

This looks a bit familiar, I hope so. Is this from linux-omap, mainline or
in-house kernel?

There were similar issues fixed by following two patches in linux-omap.
Second one is not yet in mainline, have to confirm with Tony has he queued
it now.

commit 66c23551b1b774e2be3c7bdf91c0ebf2c7a3519e
Author: Jarkko Nikula <jarkko.nikula at nokia.com>
Date:   Tue May 13 13:26:03 2008 +0300

    ARM: OMAP: DMA: Don't mark channel active in omap_enable_channel_irq

    Channel should be marked active only when DMA is really started.
    just omap_request_dma, omap_dma_link_lch and omap_dma_unlink_lch will
    incorrect dump_stack().

commit 55502f74b56f609a84d8919b9b29390b2e0147ff
Author: Jarkko Nikula <jarkko.nikula at nokia.com>
Date:   Mon Aug 18 12:28:22 2008 +0300

    ARM: OMAP: DMA: Fix uninitialized channel flags

    This has similar symptoms than 66c23551b1b774e2be3c7bdf91c0ebf2c7a3519e
    where just omap_request_dma, omap_dma_link_lch and omap_dma_unlink_lch
    can cause incorrect dump_stack(). Here it can happen if channel has been
    used before and the channel flags variable holds old status.

    Signed-off-by: Jarkko Nikula <jarkko.nikula at nokia.com>
    Signed-off-by: Tony Lindgren <tony at atomide.com>

Then it's worth to verify also this very recent fix. This is already in
mainline and will flow into linux-omap when Tony does the pull.

commit 19b3f31609dc8be3a56c78dcb7da723f10f7009c
Author: Stanley Miao <stanley.miao at windriver.com>
Date:   Fri Dec 19 22:08:22 2008 +0800

    ALSA: Fix a Oops bug in omap soc driver.

    There will be a Oops or frequent underrun messages when playing music
    omap soc driver, this is because a data region is incorretly sized,
other da
    region will be overwriten when writing to this data region.


More information about the Alsa-devel mailing list