Skip to contentSkip to conversation

switch nds32 to use the generic remapping DMA allocator

RFC New Christoph Hellwig 2 participants 6 messages Jun 14, 2019 – Jun 25, 2019

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 nds32: use the generic remapping allocator for coherent DMA allocations

Replace the code that sets up uncached PTEs with the generic vmap based remapping code. It also provides an atomic pool for allocations from non-blocking context, which we not properly supported by the existing nds32 code.

---
 arch/nds32/Kconfig      |   2 +
 arch/nds32/kernel/dma.c | 325 ++--------------------------------------
 2 files changed, 13 insertions(+), 314 deletions(-)
arch/nds32/Kconfig +2 -0
index 3299e287a477..643ea6b4bfa2 100644
@@ -7,12 +7,14 @@
 config NDS32
 	def_bool y
 	select ARCH_32BIT_OFF_T
+	select ARCH_HAS_DMA_PREP_COHERENT
 	select ARCH_HAS_SYNC_DMA_FOR_CPU
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
 	select ARCH_WANT_FRAME_POINTERS if FTRACE
 	select CLKSRC_MMIO
 	select CLONE_BACKWARDS
 	select COMMON_CLK
+	select DMA_DIRECT_REMAP
 	select GENERIC_ATOMIC64
 	select GENERIC_CPU_DEVICES
 	select GENERIC_CLOCKEVENTS
arch/nds32/kernel/dma.c +11 -314

341 lines not on this page · raw message

Signature · 6 lines
2.20.1

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu
Tested-by Reviewed-by
#2 lore raw
In reply to Christoph Hellwig

Christoph Hellwig <[email protected]> 於 2019年6月14日 週五 下午6:09寫道:

Quoted 6 lines

Hi Greentime and Vicent,

can you take a look at the (untested) patch below? It converts nds32 to use the generic remapping DMA allocator, which is also used by arm64 and csky.

Hi Christoph,

It looks good to me. I just verified in nds32 platform and it works fine. Should I put it in my next-tree or you will pick it up in your tree? :)

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

#4 lore raw

Christoph Hellwig <[email protected]> 於 2019年6月14日 週五 下午8:22寫道:

Quoted 6 lines · Greentime Hu
Quoted 2 lines

It looks good to me. I just verified in nds32 platform and it works fine. Should I put it in my next-tree or you will pick it up in your tree? :)

Either way works for me, let me know what you prefer.

I prefer to put in your tree. Thanks. :)
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu