[PATCH 10/10] Documentation: update the description for DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread Christoph Hellwig
We got rid of the odd selective consistent or not behavior, and now want the normal dma_sync_single_* functions to be used for strict ownership transfers. While dma_cache_sync hasn't been removed from the tree yet it should not be used in any new caller, so documentation for it is dropped here.

[PATCH 05/10] sparc64/iommu: move code around a bit

2018-12-08 Thread Christoph Hellwig
Move the alloc / free routines down the file so that we can easily use the map / unmap helpers to implement non-consistent allocations. Also drop the _coherent postfix to match the method name. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/iommu.c | 135

[PATCH 07/10] sparc64/pci_sun4v: move code around a bit

2018-12-08 Thread Christoph Hellwig
Move the alloc / free routines down the file so that we can easily use the map / unmap helpers to implement non-consistent allocations. Also drop the _coherent postfix to match the method name. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/pci_sun4v.c | 229

[PATCH 06/10] sparc64/iommu: implement DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread Christoph Hellwig
Just allocate the memory and use map_page to map the memory. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/iommu.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index

[PATCH 04/10] arm: implement DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread Christoph Hellwig
For the iommu ops we can just use the implementaton for DMA coherent devices. For the regular ops we need mix and match a bit so that we either use the CMA allocator without remapping, but with a special error handling case for highmem pages, or the simple allocator. Signed-off-by: Christoph

make the non-consistent DMA allocator more userful

2018-12-08 Thread Christoph Hellwig
Hi all, we had all kinds of discussions about how to best allocate DMAable memory without having to deal with the problem that your normal "coherent" DMA allocator can be very slow on platforms where DMA is not DMA coherent. To work around this drivers basically two choices at the moment: (1)

[PATCH 08/10] sparc64/pci_sun4v: implement DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread Christoph Hellwig
Just allocate the memory and use map_page to map the memory. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/pci_sun4v.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index b95c70136559..24a76ecf2986

[PATCH 02/10] arm64/iommu: don't remap contiguous allocations for coherent devices

2018-12-08 Thread Christoph Hellwig
There is no need to have an additional kernel mapping for a contiguous allocation if the device already is DMA coherent, so skip it. Signed-off-by: Christoph Hellwig --- arch/arm64/mm/dma-mapping.c | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff

[PATCH 09/10] dma-mapping: skip declared coherent memory for DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread Christoph Hellwig
Memory declared using dma_declare_coherent is ioremapped and thus not always suitable for our tightened DMA_ATTR_NON_CONSISTENT definition. Skip it given all the existing callers don't DMA_ATTR_NON_CONSISTENT anyway. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 3 ++- 1

[PATCH 03/10] arm64/iommu: implement support for DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread Christoph Hellwig
DMA_ATTR_NON_CONSISTENT forces contiguous allocations as we don't want to remap, and is otherwise forced down the same pass as if we were always on a coherent device. No new code required except for a few conditionals. Signed-off-by: Christoph Hellwig --- arch/arm64/mm/dma-mapping.c | 18

[PATCH 2/6] sparc: factor the dma coherent mapping into helper

2018-12-08 Thread Christoph Hellwig
Factor the code to remap memory returned from the DMA coherent allocator into two helpers that can be shared by the IOMMU and direct mapping code. Signed-off-by: Christoph Hellwig --- arch/sparc/kernel/ioport.c | 151 - 1 file changed, 67 insertions(+), 84

[PATCH 1/6] sparc: remove no needed sbus_dma_ops methods

2018-12-08 Thread Christoph Hellwig
No need to BUG_ON() on the cache maintainance ops - they are no-ops by default, and there is nothing in the DMA API contract that prohibits calling them on sbus devices (even if such drivers are unlikely to ever appear). Similarly a dma_supported method that always returns 0 is rather pointless.

[PATCH 5/6] sparc: move the leon PCI memory space comment to

2018-12-08 Thread Christoph Hellwig
It has nothing to do with the content of the pci.h header. Suggested by: Sam Ravnborg Signed-off-by: Christoph Hellwig --- arch/sparc/include/asm/leon.h | 9 + arch/sparc/include/asm/pci_32.h | 9 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 3/6] sparc: remove the sparc32_dma_ops indirection

2018-12-08 Thread Christoph Hellwig
There is no good reason to have a double indirection for the sparc32 dma ops, so remove the sparc32_dma_ops and define separate dma_map_ops instance for the different IOMMU types. Signed-off-by: Christoph Hellwig --- arch/sparc/include/asm/dma.h | 48 +--- arch/sparc/kernel/ioport.c

make the non-consistent DMA allocator more userful (resend)

2018-12-08 Thread Christoph Hellwig
[sorry for the spam, had to resend due a wrongly typed linux-arm-kernel address] Hi all, we had all kinds of discussions about how to best allocate DMAable memory without having to deal with the problem that your normal "coherent" DMA allocator can be very slow on platforms where DMA is not DMA

[PATCH 4/6] sparc: remove not required includes from dma-mapping.h

2018-12-08 Thread Christoph Hellwig
The only thing we need to explicitly pull in is the defines for the CPU type. Signed-off-by: Christoph Hellwig --- arch/sparc/include/asm/dma-mapping.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/sparc/include/asm/dma-mapping.h

[PATCH 6/6] sparc: merge 32-bit and 64-bit version of pci.h

2018-12-08 Thread Christoph Hellwig
There are enough common defintions that a single header seems nicer. Also drop the pointless include. Signed-off-by: Christoph Hellwig Acked-by: Sam Ravnborg --- arch/sparc/include/asm/pci.h| 53 ++--- arch/sparc/include/asm/pci_32.h | 32

Re: [PATCH 2/6] sparc: factor the dma coherent mapping into helper

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:41:11 -0800 > Factor the code to remap memory returned from the DMA coherent allocator > into two helpers that can be shared by the IOMMU and direct mapping code. > > Signed-off-by: Christoph Hellwig Acked-by: David S. Miller

Re: [PATCH 1/6] sparc: remove no needed sbus_dma_ops methods

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:41:10 -0800 > No need to BUG_ON() on the cache maintainance ops - they are no-ops > by default, and there is nothing in the DMA API contract that prohibits > calling them on sbus devices (even if such drivers are unlikely to > ever appear). > >

Re: [PATCH 05/10] sparc64/iommu: move code around a bit

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:36:57 -0800 > Move the alloc / free routines down the file so that we can easily use > the map / unmap helpers to implement non-consistent allocations. > > Also drop the _coherent postfix to match the method name. > > Signed-off-by: Christoph

Re: [PATCH 08/10] sparc64/pci_sun4v: implement DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:37:00 -0800 > Just allocate the memory and use map_page to map the memory. > > Signed-off-by: Christoph Hellwig Acked-by: David S. Miller ___ linux-snps-arc mailing list

Re: [PATCH 06/10] sparc64/iommu: implement DMA_ATTR_NON_CONSISTENT

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:36:58 -0800 > Just allocate the memory and use map_page to map the memory. > > Signed-off-by: Christoph Hellwig Acked-by: David S. Miller ___ linux-snps-arc mailing list

Re: [PATCH 07/10] sparc64/pci_sun4v: move code around a bit

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:36:59 -0800 > Move the alloc / free routines down the file so that we can easily use > the map / unmap helpers to implement non-consistent allocations. > > Also drop the _coherent postfix to match the method name. > > Signed-off-by: Christoph

Re: [PATCH 5/6] sparc: move the leon PCI memory space comment to

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:41:14 -0800 > It has nothing to do with the content of the pci.h header. > > Suggested by: Sam Ravnborg > Signed-off-by: Christoph Hellwig Acked-by: David S. Miller ___ linux-snps-arc mailing list

Re: [PATCH 6/6] sparc: merge 32-bit and 64-bit version of pci.h

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:41:15 -0800 > There are enough common defintions that a single header seems nicer. > > Also drop the pointless include. > > Signed-off-by: Christoph Hellwig > Acked-by: Sam Ravnborg Acked-by: David S. Miller

Re: [PATCH 4/6] sparc: remove not required includes from dma-mapping.h

2018-12-08 Thread David Miller
From: Christoph Hellwig Date: Sat, 8 Dec 2018 09:41:13 -0800 > The only thing we need to explicitly pull in is the defines for the > CPU type. > > Signed-off-by: Christoph Hellwig Acked-by: David S. Miller ___ linux-snps-arc mailing list