[PATCH 01/20] dma-mapping: simplify Kconfig dependencies

2018-05-11 Thread Christoph Hellwig
ARCH_DMA_ADDR_T_64BIT is always true for 64-bit architectures now, so we can skip the clause requiring it. 'n' is the default default, so no need to explicitly state it. Signed-off-by: Christoph Hellwig --- lib/Kconfig | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/li

common non-cache coherent direct dma mapping ops

2018-05-11 Thread Christoph Hellwig
Hi all, this series continues consolidating the dma-mapping code, with a focus on architectures that do not (always) provide cache coherence for DMA. Three architectures (arm, mips and powerpc) are still left to be converted later due to complexity of their dma ops selection. The dma-noncoherent

[PATCH 02/20] dma-mapping: provide a generic dma-noncoherent implementation

2018-05-11 Thread Christoph Hellwig
Add a new dma_map_ops implementation that uses dma-direct for the address mapping of streaming mappings, and which requires arch-specific implemenations of coherent allocate/free. Architectures have to provide flushing helpers to ownership trasnfers to the device and/or CPU, and can provide option

[PATCH 03/20] arc: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/arc/Kconfig | 4 + arch/arc/include/asm/Kbuild| 1 + arch/arc/include/asm/dma-mapping.h | 21 - arch/arc/mm/dma.c | 141 +++--

[PATCH 05/20] c6x: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/c6x/Kconfig | 3 + arch/c6x/include/asm/Kbuild| 1 + arch/c6x/include/asm/dma-mapping.h | 28 -- arch/c6x/include/asm/setup.h | 2 + arch/c6x/kern

[PATCH 04/20] arm-nommu: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation for the nommu dma map implementation. Signed-off-by: Christoph Hellwig --- arch/arc/Kconfig| 1 + arch/arm/Kconfig| 4 + arch/arm/mm/dma-mapping-nommu.c | 139 +--- 3 f

[PATCH 06/20] hexagon: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. This removes the previous sync_single_for_cpu implementation, which looks bogus given that no syncing is happening in the similar but more important unmap_single case. This adds the previously missing sync_sg_for_device implementati

[PATCH 07/20] m68k: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/m68k/Kconfig | 2 + arch/m68k/include/asm/Kbuild| 1 + arch/m68k/include/asm/dma-mapping.h | 12 - arch/m68k/kernel/dma.c | 68 -

[PATCH 09/20] microblaze: remove the consistent_sync and consistent_sync_page

2018-05-11 Thread Christoph Hellwig
Both unused. Signed-off-by: Christoph Hellwig --- arch/microblaze/include/asm/pgtable.h | 3 -- arch/microblaze/mm/consistent.c | 45 --- 2 files changed, 48 deletions(-) diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h i

[PATCH 08/20] microblaze: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. This removes the direction-based optimizations in sync_{single,sg}_for_{cpu,device} which were marked untestested and do not match the usually very well tested {un,}map_{single,sg} implementations. Signed-off-by: Christoph Hellwig

[PATCH 11/20] nios2: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/nios2/Kconfig | 3 + arch/nios2/include/asm/Kbuild| 1 + arch/nios2/include/asm/dma-mapping.h | 20 arch/nios2/mm/dma-mapping.c | 139 +++---

[PATCH 10/20] nds32: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. This makes sure the cache_sync routines is called in the unmap_sg case, to match the unmap_single and sync_{single,sg}_to_cpu cases. Note that this now always uses page_address, as previously done in the non-sg cache sync routines.

[PATCH 12/20] openrisc: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Fix sync_single_for_device to do the same cache coherency operations as the more tested map_single path, as both should transfer ownership to the device. Remove the sync_single_for_cpu implementation as no cache coherency operations

[PATCH 13/20] sh: simplify get_arch_dma_ops

2018-05-11 Thread Christoph Hellwig
Remove the indirection through the dma_ops variable, and just return nommu_dma_ops directly from get_arch_dma_ops. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/dma-mapping.h | 5 ++--- arch/sh/kernel/dma-nommu.c| 8 +--- arch/sh/mm/consistent.c | 3 --- arch/

[PATCH 14/20] sh: introduce a sh_cacheop_vaddr helper

2018-05-11 Thread Christoph Hellwig
And use it in the maple bus code to avoid a dma API dependency. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/cacheflush.h | 7 +++ arch/sh/mm/consistent.c | 5 + drivers/sh/maple/maple.c | 7 --- 3 files changed, 12 insertions(+), 7 deletions(-) diff --g

[PATCH 15/20] sh: use dma_direct_ops for the CONFIG_DMA_COHERENT case

2018-05-11 Thread Christoph Hellwig
This is a slight change in behavior as we avoid the detour through the virtual mapping for the coherent allocator, but if this CPU really is coherent that should be the right thing to do. Signed-off-by: Christoph Hellwig --- arch/sh/Kconfig | 1 + arch/sh/include/asm/dma-mappin

[PATCH 16/20] mm: split arch/sh/mm/consistent.c

2018-05-11 Thread Christoph Hellwig
Half of the file just contains platform device memory setup code which is required for all builds, and half contains helpers for dma coherent allocation, which is only needed if CONFIG_DMA_NONCOHERENT is enabled. Signed-off-by: Christoph Hellwig --- arch/sh/kernel/Makefile | 2 +- arch/sh

[PATCH 17/20] sh: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/sh/Kconfig | 3 +- arch/sh/include/asm/Kbuild| 1 + arch/sh/include/asm/dma-mapping.h | 26 --- arch/sh/kernel/Makefile | 2 +- arch/sh/kernel

[PATCH 18/20] xtensa: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig --- arch/xtensa/Kconfig | 3 + arch/xtensa/include/asm/Kbuild| 1 + arch/xtensa/include/asm/dma-mapping.h | 26 -- arch/xtensa/kernel/pci-dma.c | 130 +++-

[PATCH 20/20] parisc: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. Parisc previously had two different non-coherent dma ops implementation that just different in the way coherent allocations were handled or not handled. The different behavior is not selected at runtime in the arch_dma_alloc and arc

[PATCH 19/20] sparc: use generic dma_noncoherent_ops

2018-05-11 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. This removes the previous sync_single_for_device implementation, which looks bogus given that no syncing is happening in the similar but more important map_single case. Signed-off-by: Christoph Hellwig --- arch/sparc/Kconfig

Re: [PATCH 04/20] arm-nommu: use generic dma_noncoherent_ops

2018-05-11 Thread Russell King - ARM Linux
On Fri, May 11, 2018 at 09:59:29AM +0200, Christoph Hellwig wrote: > Switch to the generic noncoherent direct mapping implementation for > the nommu dma map implementation. > > Signed-off-by: Christoph Hellwig > --- > arch/arc/Kconfig| 1 + > arch/arm/Kconfig|

Re: [PATCH 03/20] arc: use generic dma_noncoherent_ops

2018-05-11 Thread Alexey Brodkin
Hi Christoph, On Fri, 2018-05-11 at 09:59 +0200, Christoph Hellwig wrote: > Switch to the generic noncoherent direct mapping implementation. > > Signed-off-by: Christoph Hellwig > --- > arch/arc/Kconfig | 4 + > arch/arc/include/asm/Kbuild| 1 + > arch/arc/include/

Re: [PATCH 04/20] arm-nommu: use generic dma_noncoherent_ops

2018-05-11 Thread John Garry
On 11/05/2018 08:59, Christoph Hellwig wrote: Switch to the generic noncoherent direct mapping implementation for the nommu dma map implementation. Signed-off-by: Christoph Hellwig --- arch/arc/Kconfig| 1 + arch/arm/Kconfig| 4 + arch/arm/mm/dma-mapping-nom