lkml.org 
[lkml]   [2018]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 004/102] ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent()
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Stefan Roese <sr@denx.de>

    commit 9066ae7ff5d89c0b5daa271e2d573540097a94fa upstream.

    When trying to use the driver (e.g. aplay *.wav), the 4MiB DMA buffer
    will get mmapp'ed in 16KiB chunks. But this fails with the 2nd 16KiB
    area, as the page offset is outside of the VMA range (size), which is
    currently used as size parameter in snd_pcm_lib_default_mmap(). By
    using the DMA buffer size (dma_bytes) instead, the complete DMA buffer
    can be mmapp'ed and the issue is fixed.

    This issue was detected on an ARM platform (TI AM57xx) using the RME
    HDSP MADI PCIe soundcard.

    Fixes: 657b1989dacf ("ALSA: pcm - Use dma_mmap_coherent() if available")
    Signed-off-by: Stefan Roese <sr@denx.de>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    sound/core/pcm_native.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/sound/core/pcm_native.c
    +++ b/sound/core/pcm_native.c
    @@ -3410,7 +3410,7 @@ int snd_pcm_lib_default_mmap(struct snd_
    area,
    substream->runtime->dma_area,
    substream->runtime->dma_addr,
    - area->vm_end - area->vm_start);
    + substream->runtime->dma_bytes);
    #endif /* CONFIG_X86 */
    /* mmap with fault handler */
    area->vm_ops = &snd_pcm_vm_ops_data_fault;

    \
     
     \ /
      Last update: 2018-04-06 16:47    [W:4.223 / U:0.680 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site