[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH AUTOSEL 5.4 195/350] ALSA: pcm: Fix missing check of the new non-cached buffer type
    From: Takashi Iwai <>

    [ Upstream commit 6111fd2370eecae9f11bfdc08ba097e0b51fcfd3 ]

    The check for the mmap support via hw_support_mmap() function misses
    the case where the device is with SNDRV_DMA_TYPE_DEV_UC, which should
    have been treated equally as SNDRV_DMA_TYPE_DEV. Let's fix it.

    Note that this bug doesn't hit any practical problem, because
    SNDRV_DMA_TYPE_DEV_UC is used only for x86-specific drivers
    (snd-hda-intel and snd-intel8x0) for the specific platforms that need
    the non-cached buffers. And, on such platforms, hw_support_mmap()
    already returns true in anyway. That's the reason I didn't put
    Cc-to-stable mark here. This is only for any theoretical future

    Fixes: 425da159707b ("ALSA: pcm: use dma_can_mmap() to check if a device supports dma_mmap_*")
    Fixes: 42e748a0b325 ("ALSA: memalloc: Add non-cached buffer type")
    Signed-off-by: Takashi Iwai <>
    Signed-off-by: Sasha Levin <>
    sound/core/pcm_native.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
    index 91c6ad58729fe..c3a139436ac26 100644
    --- a/sound/core/pcm_native.c
    +++ b/sound/core/pcm_native.c
    @@ -222,7 +222,8 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)
    return false;

    if (substream->ops->mmap ||
    - substream-> != SNDRV_DMA_TYPE_DEV)
    + (substream-> != SNDRV_DMA_TYPE_DEV &&
    + substream-> != SNDRV_DMA_TYPE_DEV_UC))
    return true;

    return dma_can_mmap(substream->;
     \ /
      Last update: 2019-12-10 22:25    [W:4.023 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site