Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: pcm: Use dma_mmap_coherent() on x86, too

We avoided the explicit use of dma_mmap_coherent() on x86 because of a
spurious warning in x86 APT code in the past. However, this blindly
assumes that the pages allocated via dma_alloc_coherent() on x86 are
the ones convertible via virt_to_page() (that is used in the default
mmap handler), and it's no longer true; with the indirect DMA ops,
this can be handled differently. The only certain way for doing mmap
such pages is the dma_mmap_coherent(), and the warning seems already
gone in the recent code, so let's use it consistently.

Link: https://lore.kernel.org/r/20200615160045.2703-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

-2
-2
sound/core/pcm_native.c
··· 3713 3713 area->vm_end - area->vm_start, area->vm_page_prot); 3714 3714 } 3715 3715 #endif /* CONFIG_GENERIC_ALLOCATOR */ 3716 - #ifndef CONFIG_X86 /* for avoiding warnings arch/x86/mm/pat.c */ 3717 3716 if (IS_ENABLED(CONFIG_HAS_DMA) && !substream->ops->page && 3718 3717 (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV || 3719 3718 substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV_UC)) ··· 3721 3722 substream->runtime->dma_area, 3722 3723 substream->runtime->dma_addr, 3723 3724 substream->runtime->dma_bytes); 3724 - #endif /* CONFIG_X86 */ 3725 3725 /* mmap with fault handler */ 3726 3726 area->vm_ops = &snd_pcm_vm_ops_data_fault; 3727 3727 return 0;