ALSA: memalloc: invalidate SG pages before sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Takashi Iwai <tiwai@xxxxxxx>

commit 3e16dc50d77dc3494275a241fac250c94bf45206 upstream.

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@xxxxxx/
Although this won't matter much in practice, let's fix the call order
for consistency.

Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation")
Reported-by: Ezequiel Garcia <ezequiel@xxxxxxxxxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20220210123344.8756-3-tiwai@xxxxxxx
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 sound/core/memalloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -541,9 +541,9 @@ static void snd_dma_noncontig_sync(struc
 	if (mode == SNDRV_DMA_SYNC_CPU) {
 		if (dmab->dev.dir == DMA_TO_DEVICE)
 			return;
+		invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
 		dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data,
 					 dmab->dev.dir);
-		invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
 	} else {
 		if (dmab->dev.dir == DMA_FROM_DEVICE)
 			return;


Patches currently in stable-queue which might be from tiwai@xxxxxxx are

queue-5.16/alsa-memalloc-fix-dma_need_sync-checks.patch
queue-5.16/alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch
queue-5.16/alsa-hda-realtek-add-quirk-for-legion-y9000x-2019.patch
queue-5.16/alsa-usb-audio-revert-to-implicit_fb_fixed_dev-for-m-audio-fasttrack-ultra.patch
queue-5.16/alsa-usb-audio-don-t-abort-resume-upon-errors.patch
queue-5.16/alsa-hda-fix-regression-on-forced-probe-mask-option.patch
queue-5.16/alsa-memalloc-invalidate-sg-pages-before-sync.patch
queue-5.16/alsa-hda-realtek-fix-deadlock-by-coef-mutex.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux