Skip to contentSkip to conversation

sh: use the generic dma coherent remap allocator

PATCH New Christoph Hellwig 1 participant 1 message Jun 28, 2019 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: use the generic dma coherent remap allocator

This switches to using common code for the DMA allocations, including potential use of the CMA allocator if configured. Also add a comment where the existing behavior seems to be lacking.

Switching to the generic code enables DMA allocations from atomic context, which is required by the DMA API documentation, and also adds various other minor features drivers start relying upon. It also makes sure we have on tested code base for all architectures that require uncached pte bits for coherent DMA allocations.

---
 arch/sh/Kconfig               |  2 ++
 arch/sh/kernel/dma-coherent.c | 51 ++---------------------------------
 2 files changed, 4 insertions(+), 49 deletions(-)
arch/sh/Kconfig +2 -0
index b77f512bb176..414e175f1826 100644
@@ -155,7 +155,9 @@ config DMA_COHERENT
 
 config DMA_NONCOHERENT
 	def_bool !DMA_COHERENT
+	select ARCH_HAS_DMA_PREP_COHERENT
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
+	select DMA_DIRECT_REMAP
 
 config PGTABLE_LEVELS
 	default 3 if X2TLB
arch/sh/kernel/dma-coherent.c +2 -49

62 lines not on this page · raw message

Signature · 1 line
2.20.1