Re: [RFC 0/2] dw_mmc: add multislot support

2018-04-20 Thread Ulf Hansson
[...] > > 2. Add missing stuff to support multislot mode in DesignWare MMC driver. > * Add missing slot switch to __dw_mci_start_request() function. > * Refactor set_ios function: >a) Calculate common clock which is > suitable for all slots instead of directly use clock value > p

Re: [RFC 0/2] dw_mmc: add multislot support

2018-04-20 Thread Alexey Brodkin
Hi Ulf, On Fri, 2018-04-20 at 09:35 +0200, Ulf Hansson wrote: > [...] > > > > > 2. Add missing stuff to support multislot mode in DesignWare MMC driver. > > * Add missing slot switch to __dw_mci_start_request() function. > > * Refactor set_ios function: > >a) Calculate common clock which i

[no subject]

2018-04-20 Thread Christoph Hellwig
To: io...@lists.linux-foundation.org Cc: linux-a...@vger.kernel.org Cc: Michal Simek Cc: Greentime Hu Cc: Vincent Chen Cc: linux-al...@vger.kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-c6x-...@linux-c6x.org Cc: linux-hexa...@vger.kernel.org

[PATCH 01/22] dma-debug: move initialization to common code

2018-04-20 Thread Christoph Hellwig
Most mainstream architectures are using 65536 entries, so lets stick to that. If someone is really desperate to override it that can still be done through , but I'd rather see a really good rationale for that. Signed-off-by: Christoph Hellwig --- arch/arm/mm/dma-mapping-nommu.c | 9 -

[PATCH 04/22] alpha: use dma_direct_ops for jensen

2018-04-20 Thread Christoph Hellwig
The generic dma_direct implementation does the same thing as the alpha pci-noop implementation, just with more bells and whistles. And unlike the current code it at least has a theoretical chance to actually compile. Signed-off-by: Christoph Hellwig --- arch/alpha/Kconfig | 1

[PATCH 02/22] dma-mapping: simplify Kconfig dependencies

2018-04-20 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

[PATCH 03/22] dma-mapping: provide a generic dma-noncoherent implementation

2018-04-20 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 05/22] alpha: simplify get_arch_dma_ops

2018-04-20 Thread Christoph Hellwig
Remove the dma_ops indirection. Signed-off-by: Christoph Hellwig --- arch/alpha/include/asm/dma-mapping.h | 4 ++-- arch/alpha/kernel/pci_iommu.c| 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-map

[PATCH 06/22] arc: use generic dma_noncoherent_ops

2018-04-20 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 08/22] c6x: use generic dma_noncoherent_ops

2018-04-20 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 10/22] m68k: use generic dma_noncoherent_ops

2018-04-20 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/22] hexagon: use generic dma_noncoherent_ops

2018-04-20 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 11/22] microblaze: use generic dma_noncoherent_ops

2018-04-20 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 12/22] microblaze: remove the consistent_sync and consistent_sync_page

2018-04-20 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 13/22] nds32: use generic dma_noncoherent_ops

2018-04-20 Thread Christoph Hellwig
Switch to the generic noncoherent direct mapping implementation. This makes sure kmap_atomic_pfn is consistently used for access to virtual addresses instead of either using the slower plain kmap or blindly expecting page_address() to work. This makes sure the cache_sync routines is called in the

[PATCH 16/22] sh: simplify get_arch_dma_ops

2018-04-20 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 15/22] openrisc: use generic dma_noncoherent_ops

2018-04-20 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 21/22] sparc: use generic dma_noncoherent_ops

2018-04-20 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

[PATCH 20/22] xtensa: use generic dma_noncoherent_ops

2018-04-20 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 22/22] parisc: use generic dma_noncoherent_ops

2018-04-20 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 18/22] sh: use dma_direct_ops for the CONFIG_DMA_COHERENT case

2018-04-20 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 14/22] nios2: use generic dma_noncoherent_ops

2018-04-20 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 17/22] sh: introduce a sh_cacheop_vaddr helper

2018-04-20 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 07/22] arm-nommu: use generic dma_noncoherent_ops

2018-04-20 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 19/22] sh: use generic dma_noncoherent_ops

2018-04-20 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 | 1 - arch/sh/kernel/

Re: [RFC 0/2] dw_mmc: add multislot support

2018-04-20 Thread Ulf Hansson
On 20 April 2018 at 09:42, Alexey Brodkin wrote: > Hi Ulf, > > On Fri, 2018-04-20 at 09:35 +0200, Ulf Hansson wrote: >> [...] >> >> > >> > 2. Add missing stuff to support multislot mode in DesignWare MMC driver. >> > * Add missing slot switch to __dw_mci_start_request() function. >> > * Refactor

Re: [PATCH 01/22] dma-debug: move initialization to common code

2018-04-20 Thread Robin Murphy
Hi Christoph, Nice cleanup! Looks good overall, just a couple of nits. On 20/04/18 09:02, Christoph Hellwig wrote: [...] diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 7f5cdc1e6b29..712a897174e4 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -41,6 +41,11 @@ #define HASH_FN_SHIFT

Re: [RFC 0/2] dw_mmc: add multislot support

2018-04-20 Thread Eugeniy Paltsev
Hi Ulf, On Fri, 2018-04-20 at 09:35 +0200, Ulf Hansson wrote: > [...] > > > > > 2. Add missing stuff to support multislot mode in DesignWare MMC driver. > > * Add missing slot switch to __dw_mci_start_request() function. > > * Refactor set_ios function: > >a) Calculate common clock which i