From 58a95dfa4fdd9c72e62be34dd025d268c1e04a83 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 2 Aug 2021 09:28:02 +0200 Subject: ALSA: memalloc: Correctly name as WC SNDRV_DMA_TYPE_DEV_UC and SNDRV_DMA_TYPE_DEV_UC_SG are incorrectly named as if they were for the uncached memory, while actually we set the pages as write-combined. Rename them to reflect the right attribute. Acked-by: Mark Brown Link: https://lore.kernel.org/r/20210802072815.13551-3-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/core/memalloc.c | 8 ++++---- sound/core/sgbuf.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sound/core') diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 1980d1e37bcc..5897d256b70d 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -387,7 +387,7 @@ static void *snd_dma_dev_alloc(struct snd_dma_buffer *dmab, size_t size) | __GFP_NOWARN; /* no stack trace print - this call is non-critical */ p = dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, gfp_flags); #ifdef CONFIG_X86 - if (p && dmab->dev.type == SNDRV_DMA_TYPE_DEV_UC) + if (p && dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC) set_memory_wc((unsigned long)p, PAGE_ALIGN(size) >> PAGE_SHIFT); #endif return p; @@ -396,7 +396,7 @@ static void *snd_dma_dev_alloc(struct snd_dma_buffer *dmab, size_t size) static void snd_dma_dev_free(struct snd_dma_buffer *dmab) { #ifdef CONFIG_X86 - if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_UC) + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC) set_memory_wb((unsigned long)dmab->area, PAGE_ALIGN(dmab->bytes) >> PAGE_SHIFT); #endif @@ -425,14 +425,14 @@ static const struct snd_malloc_ops *dma_ops[] = { [SNDRV_DMA_TYPE_VMALLOC] = &snd_dma_vmalloc_ops, #ifdef CONFIG_HAS_DMA [SNDRV_DMA_TYPE_DEV] = &snd_dma_dev_ops, - [SNDRV_DMA_TYPE_DEV_UC] = &snd_dma_dev_ops, + [SNDRV_DMA_TYPE_DEV_WC] = &snd_dma_dev_ops, #ifdef CONFIG_GENERIC_ALLOCATOR [SNDRV_DMA_TYPE_DEV_IRAM] = &snd_dma_iram_ops, #endif /* CONFIG_GENERIC_ALLOCATOR */ #endif /* CONFIG_HAS_DMA */ #ifdef CONFIG_SND_DMA_SGBUF [SNDRV_DMA_TYPE_DEV_SG] = &snd_dma_sg_ops, - [SNDRV_DMA_TYPE_DEV_UC_SG] = &snd_dma_sg_ops, + [SNDRV_DMA_TYPE_DEV_WC_SG] = &snd_dma_sg_ops, #endif }; diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c index a46129f3de12..9666a95f5a5c 100644 --- a/sound/core/sgbuf.c +++ b/sound/core/sgbuf.c @@ -43,8 +43,8 @@ static void snd_dma_sg_free(struct snd_dma_buffer *dmab) dmab->area = NULL; tmpb.dev.type = SNDRV_DMA_TYPE_DEV; - if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_UC_SG) - tmpb.dev.type = SNDRV_DMA_TYPE_DEV_UC; + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) + tmpb.dev.type = SNDRV_DMA_TYPE_DEV_WC; tmpb.dev.dev = sgbuf->dev; for (i = 0; i < sgbuf->pages; i++) { if (!(sgbuf->table[i].addr & ~PAGE_MASK)) @@ -77,8 +77,8 @@ static void *snd_dma_sg_alloc(struct snd_dma_buffer *dmab, size_t size) dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); if (!sgbuf) return NULL; - if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_UC_SG) { - type = SNDRV_DMA_TYPE_DEV_UC; + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) { + type = SNDRV_DMA_TYPE_DEV_WC; #ifdef pgprot_noncached prot = pgprot_noncached(PAGE_KERNEL); #endif -- cgit