Skip to content

Add dma_mmap_coherent() for other archs

Takashi Iwai linux-arch linux-parisc 1 version In review

Get series with b4
b4 am s5hprc8n0od.wl%[email protected]

Versions newest first

  1. v1 Latest8 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8mips: implement dma_mmap_coherent()arch/mips/include/asm/dma-mapping.h arch/mips/mm/dma-default.c+17 -00 replies
2/8arm: Define ARCH_HAS_DMA_MMAP_COHERENTarch/arm/include/asm/dma-mapping.h+1 -00 replies
3/8parisc: implement dma_mmap_coherent()arch/parisc/include/asm/dma-mapping.h arch/parisc/kernel/pci-dma.c drivers/parisc/ccio-dma.c +2 more+47 -08 replies
4/8sh: implement dma_mmap_coherent()arch/sh/include/asm/dma-mapping.h arch/sh/mm/consistent.c+17 -00 replies
5/8sparc: implement dma_mmap_coherent()arch/sparc/include/asm/dma-mapping.h arch/sparc/kernel/dma.c arch/sparc/kernel/dma.h +1 more+37 -00 replies
6/8powerpc: implement dma_mmap_coherent()arch/powerpc/include/asm/dma-mapping.h arch/powerpc/kernel/dma.c+43 -00 replies
7/8x86: implement dma_mmap_coherent()arch/x86/include/asm/dma-mapping.h include/linux/dma-mapping.h+18 -00 replies
8/8ia64: implement dma_mmap_coherent()arch/ia64/include/asm/dma-mapping.h+16 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] Add dma_mmap_coherent() for other archs

Hi,

currently, there is no uniformed way to mmap the pages allocated via dma_alloc_coherent() properly. This is a long-standing issue in the ALSA PCM code, which causes Oops on some non-coherent architectures.

ARM has already a function dma_mmap_coherent() for that purpose. This patch series is for adding the same function to other major architectures to improve the situation (read: not "solve" perfectly :)

I tried to keep the addition as simple and small as possible. As I couldn't do build tests on some archs, some patches might be wrong. A fix patch would be appreciated.

Also, I added ARCH_HAS_DMA_MMAP_COHERENT for each definition so that the caller can know whether the function is available. This is actually more helpful than giving a dummy inline function (at least in the case of ALSA code) since it can be optimized at the compile time. Maybe another name would be better, or there is a more clever way. In anyways, comments and suggestions are greatly appreciated.

The patches can be found on test/dma-fix branch of sound git tree, too.
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git test/dma-fix

thanks,

Takashi