Skip to content

Commit 3e16dc5

Browse files
committed
ALSA: memalloc: invalidate SG pages before sync
It seems that calling invalidate_kernel_vmap_range() is more correct to be called before dma_sync_*(), judging from the other thread: https://lore.kernel.org/all/20220111085958.GA22795@lst.de/ Although this won't matter much in practice, let's fix the call order for consistency. Fixes: a25684a ("ALSA: memalloc: Support for non-contiguous page allocation") Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220210123344.8756-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 8e1741c commit 3e16dc5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/core/memalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ static void snd_dma_noncontig_sync(struct snd_dma_buffer *dmab,
541541
if (mode == SNDRV_DMA_SYNC_CPU) {
542542
if (dmab->dev.dir == DMA_TO_DEVICE)
543543
return;
544+
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
544545
dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data,
545546
dmab->dev.dir);
546-
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
547547
} else {
548548
if (dmab->dev.dir == DMA_FROM_DEVICE)
549549
return;

0 commit comments

Comments
 (0)