Skip to content

Commit dc0dc8a

Browse files
committed
ALSA: pcm: Fix mmap breakage without explicit buffer setup
The recent fix c4824ae ("ALSA: pcm: Fix mmap capability check") restricts the mmap capability only to the drivers that properly set up the buffers, but it caused a regression for a few drivers that manage the buffer on its own way. For those with UNKNOWN buffer type (i.e. the uninitialized / unused substream->dma_buffer), just assume that the driver handles the mmap properly and blindly trust the hardware info bit. Fixes: c4824ae ("ALSA: pcm: Fix mmap capability check") Reported-and-tested-by: Jeff Woods <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 739d095 commit dc0dc8a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sound/core/pcm_native.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ static bool hw_support_mmap(struct snd_pcm_substream *substream)
251251

252252
switch (substream->dma_buffer.dev.type) {
253253
case SNDRV_DMA_TYPE_UNKNOWN:
254-
return false;
254+
/* we can't know the device, so just assume that the driver does
255+
* everything right
256+
*/
257+
return true;
255258
case SNDRV_DMA_TYPE_CONTINUOUS:
256259
case SNDRV_DMA_TYPE_VMALLOC:
257260
return true;

0 commit comments

Comments
 (0)