summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-08-04 08:13:29 +0200
committerTakashi Iwai <tiwai@suse.de>2021-08-04 08:13:54 +0200
commit623c10108338b6b4e2c99de9fbc785f30b526c54 (patch)
tree448d45414f6e7d839a27db514e20c7591db08e9a /sound/core
parentba447289fd06c8678eaf51ccffb1b0c9a6a56c9a (diff)
ALSA: memalloc: Fix pgprot for WC mmap on x86
We have a special handling of WC pages on x86, and it's currently specific to HD-audio. The last forgotten piece was the pgprot setup for the mmap with WC pages. This patch moves the pgprot setup for WC pages from HD-audio-specific mmap callback to the common helper code. It allows us to remove the superfluous mmap callback in HD-audio and its prepare_mmap redirection. Link: https://lore.kernel.org/r/20210804061329.29265-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/memalloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 58bab2cfdb87..084b2600a423 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -407,6 +407,10 @@ static void snd_dma_dev_free(struct snd_dma_buffer *dmab)
static int snd_dma_dev_mmap(struct snd_dma_buffer *dmab,
struct vm_area_struct *area)
{
+#ifdef CONFIG_X86
+ if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
+ area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
+#endif
return dma_mmap_coherent(dmab->dev.dev, area,
dmab->area, dmab->addr, dmab->bytes);
}