]> git.baikalelectronics.ru Git - kernel.git/commit
dma-mapping: move the arm64 noncoherent alloc/free support to common code
authorChristoph Hellwig <hch@lst.de>
Sun, 4 Nov 2018 19:29:28 +0000 (20:29 +0100)
committerChristoph Hellwig <hch@lst.de>
Sat, 1 Dec 2018 17:07:11 +0000 (18:07 +0100)
commit936488e221b4f33343f8fdc1fbf3f04b307a490a
treec7dbe5478677405c690334e59acc392c5db86858
parent2e5fd3cbefb7fd941822ac6f5322464699d24b01
dma-mapping: move the arm64 noncoherent alloc/free support to common code

The arm64 codebase to implement coherent dma allocation for architectures
with non-coherent DMA is a good start for a generic implementation, given
that is uses the generic remap helpers, provides the atomic pool for
allocations that can't sleep and still is realtively simple and well
tested.  Move it to kernel/dma and allow architectures to opt into it
using a config symbol.  Architectures just need to provide a new
arch_dma_prep_coherent helper to writeback an invalidate the caches
for any memory that gets remapped for uncached access.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
arch/arm64/Kconfig
arch/arm64/mm/dma-mapping.c
include/linux/dma-mapping.h
include/linux/dma-noncoherent.h
kernel/dma/Kconfig
kernel/dma/remap.c