[PATCH 08/16] frv: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/frv/Kconfig | 2 + arch/frv/include/asm/dma-mapping.h| 132 ++ arch/frv/mb93090-mb00/pci-dma-nommu.c | 72 --- arch/frv/mb93090-mb00/pci-dma.c

[PATCH 15/16] dma-mapping: always provide the dma_map_ops based implementation

2015-11-10 Thread Christoph Hellwig
Move the generic implementation to now that all architectures support it and remove the HAVE_DMA_ATTR Kconfig symbol now that everyone supports them. Signed-off-by: Christoph Hellwig <h...@lst.de> --- Documentation/DMA-API-HOWTO.txt| 10 - .../features/io/dma_map_attr

[PATCH 13/16] sparc: use generic dma_set_mask

2015-11-10 Thread Christoph Hellwig
Sparc already uses the same code as the generic code for the PCI implementation but just fails the call sbus. This moves to the generic implemenation which eventually return -EIO due to the NULL dma_mask pointer in the device. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch

[PATCH 02/16] arc: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arc/Kconfig | 1 + arch/arc/include/asm/dma-mapping.h | 187 + arch/arc/mm/dma.c | 151 -- 3 files changed, 109 insertions(+), 230 del

[PATCH 03/16] avr32: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/avr32/Kconfig | 1 + arch/avr32/include/asm/dma-mapping.h | 342 +-- arch/avr32/mm/dma-coherent.c | 115 3 files changed, 85 insertions(+), 373 deletions(-) diff

use dma_map_ops for all architectures

2015-11-10 Thread Christoph Hellwig
This series converts all remaining architectures to use dma_map_ops and the generic implementation of the DMA API. This not only simplifies the code a lot, but also prepares for possible future changes like more generic non-iommu dma_ops implementations or generic per-device dma_map_ops. A git

[PATCH 07/16] nios2: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/nios2/Kconfig | 1 + arch/nios2/include/asm/dma-mapping.h | 123 ++--- arch/nios2/mm/dma-mapping.c | 147 +++ 3 files changed, 85 insertions(+

[PATCH 14/16] tile: uninline dma_set_mask

2015-11-10 Thread Christoph Hellwig
We'll soon merge into and the reference to dma_capable in the tile dma_set_mask would create a circular dependency. Fix this by moving the implementation out of line. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/tile/include/asm/dma-mapping.

[PATCH 12/16] metag: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/metag/Kconfig | 1 + arch/metag/include/asm/dma-mapping.h | 179 +-- arch/metag/kernel/dma.c | 146 +--- 3 files changed, 117 insertions(+

[PATCH 06/16] cris: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/cris/Kconfig| 1 + arch/cris/arch-v32/drivers/pci/dma.c | 54 +--- arch/cris/include/asm/dma-mapping.h | 161 ++- 3 files changed, 51 insertions(+), 165 deletions(-) diff

[PATCH 04/16] blackfin: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/blackfin/Kconfig | 1 + arch/blackfin/include/asm/dma-mapping.h | 127 +--- arch/blackfin/kernel/dma-mapping.c | 52 + 3 files changed, 43 insertions(+), 137 del

[PATCH 10/16] mn10300: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/mn10300/Kconfig | 2 + arch/mn10300/include/asm/dma-mapping.h | 161 + arch/mn10300/mm/dma-alloc.c| 67 -- 3 files changed, 67 insertions(+), 163 deletions(-)

[PATCH 09/16] parisc: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/parisc/Kconfig | 2 + arch/parisc/include/asm/dma-mapping.h | 189 ++ arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/pci-dma.c | 92 ++--- d

[PATCH 11/16] m68k: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/m68k/Kconfig | 1 + arch/m68k/include/asm/dma-mapping.h | 112 ++-- arch/m68k/kernel/dma.c | 61 +--- 3 files changed, 32 insertions(+), 142 deletions(-)

[PATCH 05/16] c6x: convert to dma_map_ops

2015-11-10 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/c6x/Kconfig | 2 + arch/c6x/include/asm/dma-mapping.h | 96 ++ arch/c6x/kernel/dma.c | 91 3 files changed, 47 insertions(+

[PATCH 01/16] dma-mapping: make the generic coherent dma mmap implementation optional

2015-11-10 Thread Christoph Hellwig
We have a couple architectures that do not want to support this code, so add another Kconfig symbol that disables the code similar to what we do for the nommu case. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/Kconfig | 3 +++ drivers/base/dma-mapping.c | 4 ++-- 2

Re: [RFC v2] dma-mapping: Use unsigned long for dma_attrs

2016-05-31 Thread Christoph Hellwig
On Mon, May 30, 2016 at 01:54:06PM +0200, Krzysztof Kozlowski wrote: > The dma-mapping core and the implementations do not change the > DMA attributes passed by pointer. Thus the pointer can point to const > data. However the attributes do not have to be a bitfield. Instead > unsigned long will

Re: [RFC v2] dma-mapping: Use unsigned long for dma_attrs

2016-06-01 Thread Christoph Hellwig
On Wed, Jun 01, 2016 at 07:36:42AM +0200, Krzysztof Kozlowski wrote: > > No really for this patch, but I would much prefer to document them next > > to the code in the long run. Also I really think these BIT() macros > > are a distraction compared to the (1 << N) notation. > > Not much

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-15 Thread Christoph Hellwig
On Fri, Mar 11, 2016 at 01:58:46PM +0100, Niklas S?derlund wrote: > Without an IOMMU this is easy since the phys_addr_t and dma_addr_t are > the same and no special care is needed. However if you have a IOMMU you > need to map the DMA slave phys_addr_t to a dma_addr_t using something > like

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-11 Thread Christoph Hellwig
On Thu, Mar 10, 2016 at 10:47:10PM -0800, Dan Williams wrote: > I think it is confusing to use the dma_ prefix for this peer-to-peer > mmio functionality. dma_addr_t is a device's view of host memory. > Something like bus_addr_t bus_map_resource(). Doesn't this routine > also need the source

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-21 Thread Christoph Hellwig
On Thu, Mar 17, 2016 at 01:33:51PM +0200, Laurent Pinchart wrote: > The good news is that, given that no code uses this new API at the moment, > there isn't much to audit. The patch series implements the resource mapping > for arch/arm only, and makes use of it in the rcar-dmac driver only.

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-07 Thread Christoph Hellwig
Please add some documentation on where/how this should be used. It's not a very obvious interface. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-04-25 Thread Christoph Hellwig
On Mon, Apr 25, 2016 at 04:26:19PM +0200, Niklas S?derlund wrote: > I have followed the call path from the usage in > drivers/dma/sh/rcar-dmac.c and made sure the dma_addr_t is not used in a > bad way. The dma-debug routines are called from the generic code in include/linux/dma-mapping.h, and

Re: [PATCH 0/4] dma-mapping: Constify dma_attrs

2016-05-24 Thread Christoph Hellwig
I think this is moving into the wrong direction. The right fix here is to get of all the dma_attrs boilerplate code and just replace it with a simple enum dma_flags. This would simplify both the callers and most importantly the wrappers for the flag-less versions a lot.

mailing list for the dma mapping code

2017-07-17 Thread Christoph Hellwig
Hi all, currently the dma-mapping code doesn't have a dedicated mailing list, and thus posts get lots on linux-kernel. I wonder if we should add a new separate list for it, or if it makes sense to reuse the existing iommu list given that there is a fair amount of overlap.

Re: [RFC PATCH 4/5] iommu/dma: Export non-static functions to use in modules

2017-07-06 Thread Christoph Hellwig
On Thu, Jul 06, 2017 at 12:09:45PM +0100, Robin Murphy wrote: > I suppose another option is to just make the IOMMU and DMA ops a > self-contained non-modular driver mirroring the VT-d/AMD-Vi IOMMUs - > AFAICS it shouldn't have to be all that tightly coupled to the IPU bus > code, the latter more

Re: [RFC PATCH 1/5] base: dma-mapping: Export commonly used symbols

2017-07-05 Thread Christoph Hellwig
Please use EXPORT_SYMBOL_GPL for any of these exports, as they are internal linux implementration details by any definition of it. On Wed, Jul 05, 2017 at 04:12:11PM +0900, Tomasz Figa wrote: > There is nothing wrong in having a loadable module implementing DMA API, > for example to be used for

Re: [RFC PATCH 1/5] base: dma-mapping: Export commonly used symbols

2017-07-05 Thread Christoph Hellwig
On Thu, Jul 06, 2017 at 12:22:35AM +0900, Tomasz Figa wrote: > Generally the user is a work in progress that should be posted in a > very near future. You can find a reference to our downstream tree at > chromium.org in the cover letter. Obviously I don't mind including > patches from this series

Re: DMA_ATTR_WEAK_ORDERING defintion, was Re: [PATCH] nvme: set DMA_ATTR_WEAK_ORDERING attribute on dma buffers

2017-07-05 Thread Christoph Hellwig
On Tue, Jun 27, 2017 at 04:46:31PM -0400, chris hyser wrote: > I put this in for SPARC. In our case the host bridge/RC itself follows very > strict ordering unless the relaxed order bit is set in the TLP. This works > great for devices that actually allow the driver to enable it. We however >

Re: [PATCH v6 25/34] swiotlb: Add warnings for use of bounce buffers with SME

2017-06-08 Thread Christoph Hellwig
On Wed, Jun 07, 2017 at 02:17:32PM -0500, Tom Lendacky wrote: > Add warnings to let the user know when bounce buffers are being used for > DMA when SME is active. Since the bounce buffers are not in encrypted > memory, these notifications are to allow the user to determine some > appropriate

new dma-mapping tree, was Re: clean up and modularize arch dma_mapping interface V2

2017-06-20 Thread Christoph Hellwig
On Fri, Jun 16, 2017 at 08:10:15PM +0200, Christoph Hellwig wrote: > I plan to create a new dma-mapping tree to collect all this work. > Any volunteers for co-maintainers, especially from the iommu gang? Ok, I've created the new tree: git://git.infradead.org/users/hch/dma-mapping.git fo

Re: new dma-mapping tree, was Re: clean up and modularize arch dma_mapping interface V2

2017-06-20 Thread Christoph Hellwig
On Tue, Jun 20, 2017 at 02:14:36PM +0100, Robin Murphy wrote: > Hi Christoph, > > On 20/06/17 13:41, Christoph Hellwig wrote: > > On Fri, Jun 16, 2017 at 08:10:15PM +0200, Christoph Hellwig wrote: > >> I plan to create a new dma-mapping tree to collect all this work. &g

Re: new dma-mapping tree, was Re: clean up and modularize arch dma_mapping interface V2

2017-06-20 Thread Christoph Hellwig
On Tue, Jun 20, 2017 at 11:04:00PM +1000, Stephen Rothwell wrote: > git://git.linaro.org/people/mszyprowski/linux-dma-mapping.git#dma-mapping-next > > Contacts: Marek Szyprowski and Kyungmin Park (cc'd) > > I have called your tree dma-mapping-hch for now. The other tree has > not been updated

Re: clean up and modularize arch dma_mapping interface

2017-06-20 Thread Christoph Hellwig
On Tue, Jun 20, 2017 at 11:19:02AM +0200, Daniel Vetter wrote: > Ack for the 2 drm patches, but I can also pick them up through drm-misc if > you prefer that (but then it'll be 4.14). Nah, I'll plan to set up a dma-mapping tree so that we'll have common place for dma-mapping work.

Re: clean up and modularize arch dma_mapping interface V2

2017-06-24 Thread Christoph Hellwig
On Wed, Jun 21, 2017 at 12:24:28PM -0700, tndave wrote: > Thanks for doing this. > So archs can still have their own definition for dma_set_mask() if > HAVE_ARCH_DMA_SET_MASK is y? > (and similarly for dma_set_coherent_mask() when > CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK is y) > Any plan to

DMA_ATTR_WEAK_ORDERING defintion, was Re: [PATCH] nvme: set DMA_ATTR_WEAK_ORDERING attribute on dma buffers

2017-06-24 Thread Christoph Hellwig
I always assumed that our streaming mappings are relaxed order for TLP anyway. And at very least Documentation/DMA-attributes.txt seems to imply something different: DMA_ATTR_WEAK_ORDERING -- DMA_ATTR_WEAK_ORDERING specifies that reads and writes to the mapping may

Re: new dma-mapping tree, was Re: clean up and modularize arch dma_mapping interface V2

2017-06-26 Thread Christoph Hellwig
On Wed, Jun 21, 2017 at 03:32:39PM +0200, Marek Szyprowski wrote: > linux-next > was a side effect of that. I think that for now it can be dropped in favor > of > Christoph's tree. I can also do some review and help in maintainers work if > needed, although I was recently busy with other stuff. >

Re: clean up and modularize arch dma_mapping interface V2

2017-06-26 Thread Christoph Hellwig
On Sat, Jun 24, 2017 at 10:36:56AM -0500, Benjamin Herrenschmidt wrote: > I think we still need to do it. For example we have a bunch new "funky" > cases. I have no plan to do away with the selection - I just want a better interface than the current one.

[PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is not a public API and will go away soon. dma dma-iommu driver already implements a proper ->mapping_error method, so it's only using the value internally. Add a new local define using the value that arm64 which is the only current user of dma-iommu. Signed-off-by: Christ

[PATCH 07/44] xen-swiotlb: consolidate xen_swiotlb_dma_ops

2017-06-08 Thread Christoph Hellwig
for xen_swiotlb_dma_ops can now be marked static as well. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/xen/mm.c | 17 arch/x86/xen/pci-swiotlb-xen.c | 14 --- drivers/xen/swiotlb-xen.c | 93 ++ include/xen/swiotlb-xen.h

[PATCH 08/44] xen-swiotlb: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/xen/swiotlb-xen.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index a0f006

[PATCH 17/44] hexagon: switch to use ->mapping_error for error reporting

2017-06-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/hexagon/include/asm/dma-mapping.h | 2 -- arch/hexagon/kernel/dma.c | 12 +--- arch/hexagon/kernel/hexagon_ksyms.c| 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/hexagon/include/a

[PATCH 16/44] arm64: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
The dma alloc interface returns an error by return NULL, and the mapping interfaces rely on the mapping_error method, which the dummy ops already implement correctly. Thus remove the DMA_ERROR_CODE define. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm64/include/asm/dma-map

[PATCH 14/44] sh: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
sh does not return errors for dma_map_page. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/sh/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index d99008af5f73..9b06be07db4d

[PATCH 15/44] xtensa: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
xtensa already implements the mapping_error method for its only dma_map_ops instance. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/xtensa/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/a

[PATCH 13/44] openrisc: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
openrisc does not return errors for dma_map_page. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/openrisc/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/openrisc/include/asm/dma-mapping.h b/arch/openrisc/include/asm/dma-mapping.h index 0c0075

[PATCH 01/44] firmware/ivc: use dma_mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is not supposed to be used by drivers. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/firmware/tegra/ivc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/tegra/ivc.c b/drivers/firmware/tegra/ivc.c index 29ecfd

[PATCH 02/44] ibmveth: properly unwind on init errors

2017-06-08 Thread Christoph Hellwig
That way the driver doesn't have to rely on DMA_ERROR_CODE, which is not a public API and going away. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/net/ethernet/ibm/ibmveth.c | 159 + 1 file changed, 74 insertions(+), 85 deletions(-) diff

[PATCH 12/44] microblaze: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
microblaze does not return errors for dma_map_page. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/microblaze/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h

[PATCH 11/44] m32r: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
dma-noop is the only dma_mapping_ops instance for m32r and does not return errors. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/m32r/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/m32r/include/asm/dma-mapping.h b/arch/m32r/include/a

[PATCH 09/44] c6x: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/c6x/include/asm/dma-mapping.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h index aca9f755e4f8..05daf1038111 100644 --- a/arch/c6x/include/asm/dma-map

[PATCH 10/44] ia64: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
All ia64 dma_mapping_ops instances already have a mapping_error member. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/ia64/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h

[PATCH 22/44] x86/pci-nommu: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/kernel/pci-nommu.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index a88952

[PATCH 34/44] arm: remove arch specific dma_supported implementation

2017-06-08 Thread Christoph Hellwig
And instead wire it up as method for all the dma_map_ops instances. Note that the code seems a little fishy for dmabounce and iommu, but for now I'd like to preserve the existing behavior 1:1. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/common/dmabounce.c| 1 + ar

[PATCH 23/44] x86/calgary: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/kernel/pci-calgary_64.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kern

[PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching

2017-06-08 Thread Christoph Hellwig
Besides removing the last instance of the set_dma_mask method this also reduced the code duplication. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/platforms/cell/iommu.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/arch/p

[PATCH 26/44] dma-mapping: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
And update the documentation - dma_mapping_error has been supported everywhere for a long time. Signed-off-by: Christoph Hellwig <h...@lst.de> --- Documentation/DMA-API-HOWTO.txt | 31 +-- include/linux/dma-mapping.h | 5 - 2 files changed, 5 inse

[PATCH 36/44] dma-mapping: remove HAVE_ARCH_DMA_SUPPORTED

2017-06-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- include/linux/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index a57875309bfd..3e5908656226 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-map

[PATCH 24/44] x86: remove DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
All dma_map_ops instances now handle their errors through ->mapping_error. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mappin

[PATCH 39/44] xen-swiotlb: remove xen_swiotlb_set_dma_mask

2017-06-08 Thread Christoph Hellwig
This just duplicates the generic implementation. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/xen/swiotlb-xen.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index c3a04b2d7532..82fc54f8eb77

[PATCH 28/44] sparc: remove arch specific dma_supported implementations

2017-06-08 Thread Christoph Hellwig
ich means always supported. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/sparc/include/asm/dma-mapping.h | 3 --- arch/sparc/kernel/iommu.c| 40 +++- arch/sparc/kernel/ioport.c | 22 ++-- arch/sparc/kernel/pc

[PATCH 29/44] dma-noop: remove dma_supported and mapping_error methods

2017-06-08 Thread Christoph Hellwig
These just duplicate the default behavior if no method is provided. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-noop.c | 12 1 file changed, 12 deletions(-) diff --git a/lib/dma-noop.c b/lib/dma-noop.c index de26c8b68f34..643a074f139d 100644 --- a/lib/dma-

[PATCH 20/44] sparc: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/sparc/include/asm/dma-mapping.h | 2 -- arch/sparc/kernel/iommu.c| 12 +--- arch/sparc/kernel/iommu_common.h | 2 ++ arch/sparc/kernel/pci_s

[PATCH 05/44] drm/armada: don't abuse DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
dev_addr isn't even a dma_addr_t, and DMA_ERROR_CODE has never been a valid driver API. Add a bool mapped flag instead. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/gpu/drm/armada/armada_fb.c | 2 +- drivers/gpu/drm/armada/armada_gem.c | 5 ++--- drivers/gpu/drm/

[PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is not a public API and will go away. Instead properly unwind based on the loop counter. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/dma/ioat/init.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/dm

[PATCH 04/44] drm/exynos: don't use DMA_ERROR_CODE

2017-06-08 Thread Christoph Hellwig
return 0. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/gpu/drm/exynos/exynos_drm_fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index c77a5aced81a..d48fd7c918f8

[PATCH 33/44] openrisc: remove arch-specific dma_supported implementation

2017-06-08 Thread Christoph Hellwig
This implementation is simply bogus - hexagon only has a simple direct mapped DMA implementation and thus doesn't care about the address. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/openrisc/include/asm/dma-mapping.h | 7 --- 1 file changed, 7 deletions(-) diff --git

[PATCH 25/44] arm: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/common/dmabounce.c| 16 --- arch/arm/include/asm/dma-iommu.h | 2 ++ arch/arm/include/asm/dma-mapping.h | 1 - arch/arm/mm/dma-mapping.c

[PATCH 18/44] iommu/amd: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/iommu/amd_iommu.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 63cacf

[PATCH 35/44] x86: remove arch specific dma_supported implementation

2017-06-08 Thread Christoph Hellwig
And instead wire it up as method for all the dma_map_ops instances. Note that this also means the arch specific check will be fully instead of partially applied in the AMD iommu driver. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/dma-mapping.h | 3 --- ar

[PATCH 37/44] mips/loongson64: implement ->dma_supported instead of ->set_dma_mask

2017-06-08 Thread Christoph Hellwig
Same behavior, less code duplication. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/mips/loongson64/common/dma-swiotlb.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/mips/loongson64/common/dma-swiotlb.c b/arch/mips/loongson64/comm

[PATCH 32/44] hexagon: remove the unused dma_is_consistent prototype

2017-06-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/hexagon/include/asm/dma-mapping.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index 9c15cb5271a6..463dbc18f853 100644 --- a/arch/hexagon/include/a

[PATCH 41/44] powerpc/cell: clean up fixed mapping dma_ops initialization

2017-06-08 Thread Christoph Hellwig
By the time cell_pci_dma_dev_setup calls cell_dma_dev_setup no device can have the fixed map_ops set yet as it's only set by the set_dma_mask method. So move the setup for the fixed case to be only called in that place instead of indirecting through cell_dma_dev_setup. Signed-off-by: Christoph

[PATCH 38/44] arm: implement ->dma_supported instead of ->set_dma_mask

2017-06-08 Thread Christoph Hellwig
Same behavior, less code duplication. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/common/dmabounce.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 4aabf117e136..d89a0b56b245

[PATCH 31/44] hexagon: remove arch-specific dma_supported implementation

2017-06-08 Thread Christoph Hellwig
This implementation is simply bogus - hexagon only has a simple direct mapped DMA implementation and thus doesn't care about the address. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/hexagon/include/asm/dma-mapping.h | 2 -- arch/hexagon/kernel/dma.c | 9 --

[PATCH 44/44] powerpc: merge __dma_set_mask into dma_set_mask

2017-06-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/include/asm/dma-mapping.h | 1 - arch/powerpc/kernel/dma.c | 13 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/a

[PATCH 27/44] sparc: remove leon_dma_ops

2017-06-08 Thread Christoph Hellwig
We can just use pci32_dma_ops. Btw, given that leon is 32-bit and appears to be PCI based, do even need the special case for it in get_arch_dma_ops at all? Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/sparc/include/asm/dma-mapping.h | 3 +-- arch/sparc/kernel/ioport.c

[PATCH 40/44] tile: remove dma_supported and mapping_error methods

2017-06-08 Thread Christoph Hellwig
These just duplicate the default behavior if no method is provided. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/tile/kernel/pci-dma.c | 30 -- 1 file changed, 30 deletions(-) diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c

[PATCH 43/44] dma-mapping: remove the set_dma_mask method

2017-06-08 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/kernel/dma.c | 4 include/linux/dma-mapping.h | 6 -- 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 41c749586bd2..466c9f07b288 100644 --- a/arch/powerpc/

[PATCH 30/44] dma-virt: remove dma_supported and mapping_error methods

2017-06-08 Thread Christoph Hellwig
These just duplicate the default behavior if no method is provided. Signed-off-by: Christoph Hellwig <h...@lst.de> --- lib/dma-virt.c | 12 1 file changed, 12 deletions(-) diff --git a/lib/dma-virt.c b/lib/dma-virt.c index dcd4df1f7174..5c4f11329721 100644 --- a/lib/dma-

[PATCH 21/44] powerpc: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Instead define a ->mapping_error method for all IOMMU based dma operation instances. The direct ops don't ever return an error and don't need a ->mapping_error method. Signed-off-by: Christoph Hellwig <h...@lst.de> ---

[PATCH 19/44] s390: implement ->mapping_error

2017-06-08 Thread Christoph Hellwig
s390 can also use noop_dma_ops, and while that currently does not return errors it will so in the future. Implementing the mapping_error method is the proper way to have per-ops error conditions. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/s390/include/asm/dma-mapping.

clean up and modularize arch dma_mapping interface

2017-06-08 Thread Christoph Hellwig
Hi all, for a while we have a generic implementation of the dma mapping routines that call into per-arch or per-device operations. But right now there still are various bits in the interfaces where don't clearly operate on these ops. This series tries to clean up a lot of those (but not all

[PATCH 38/44] arm: implement ->dma_supported instead of ->set_dma_mask

2017-06-16 Thread Christoph Hellwig
Same behavior, less code duplication. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/common/dmabounce.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 6ecd5be5d37e..9a92de63426f

[PATCH 22/44] x86/pci-nommu: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/kernel/pci-nommu.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index a88952

[PATCH 09/44] c6x: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/c6x/include/asm/dma-mapping.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h index aca9f755e4f8..05daf1038111 100644 --- a/arch/c6x/include/asm/dma-map

[PATCH 02/44] ibmveth: properly unwind on init errors

2017-06-16 Thread Christoph Hellwig
That way the driver doesn't have to rely on DMA_ERROR_CODE, which is not a public API and going away. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: David S. Miller <da...@davemloft.net> --- drivers/net/ethernet/ibm/ibmveth.c | 159 + 1

[PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is not a public API and will go away soon. dma dma-iommu driver already implements a proper ->mapping_error method, so it's only using the value internally. Add a new local define using the value that arm64 which is the only current user of dma-iommu. Signed-off-by: Christ

[PATCH 05/44] drm/armada: don't abuse DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
dev_addr isn't even a dma_addr_t, and DMA_ERROR_CODE has never been a valid driver API. Add a bool mapped flag instead. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/gpu/drm/armada/armada_fb.c | 2 +- drivers/gpu/drm/armada/armada_gem.c | 5 ++--- drivers/gpu/drm/

clean up and modularize arch dma_mapping interface V2

2017-06-16 Thread Christoph Hellwig
Hi all, for a while we have a generic implementation of the dma mapping routines that call into per-arch or per-device operations. But right now there still are various bits in the interfaces where don't clearly operate on these ops. This series tries to clean up a lot of those (but not all

[PATCH 04/44] drm/exynos: don't use DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
return 0. Signed-off-by: Christoph Hellwig <h...@lst.de> --- drivers/gpu/drm/exynos/exynos_drm_fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index c77a5aced81a..d48fd7c918f8

[PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is not a public API and will go away. Instead properly unwind based on the loop counter. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Dave Jiang <dave.ji...@intel.com> Acked-By: Vinod Koul <vinod.k...@intel.com> --- drivers/dm

[PATCH 34/44] arm: remove arch specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
And instead wire it up as method for all the dma_map_ops instances. Note that the code seems a little fishy for dmabounce and iommu, but for now I'd like to preserve the existing behavior 1:1. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/arm/common/dmabounce.c| 1 + ar

[PATCH 17/44] hexagon: switch to use ->mapping_error for error reporting

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Richard Kuo <r...@codeaurora.org> --- arch/hexagon/include/asm/dma-mapping.h | 2 -- arch/hexagon/kernel/dma.c | 12 +--- arch/hexagon/kernel/hexagon_ksyms.c| 1 - 3 files changed, 9 insertions(+),

[PATCH 35/44] x86: remove arch specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
And instead wire it up as method for all the dma_map_ops instances. Note that this also means the arch specific check will be fully instead of partially applied in the AMD iommu driver. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/include/asm/dma-mapping.h | 3 --- ar

[PATCH 21/44] powerpc: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Instead define a ->mapping_error method for all IOMMU based dma operation instances. The direct ops don't ever return an error and don't need a ->mapping_error method. Signed-off-by: Christoph Hellwig <h...@lst.de> Acked

[PATCH 43/44] dma-mapping: remove the set_dma_mask method

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/kernel/dma.c | 4 include/linux/dma-mapping.h | 6 -- 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 41c749586bd2..466c9f07b288 100644 --- a/arch/powerpc/

[PATCH 23/44] x86/calgary: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/x86/kernel/pci-calgary_64.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kern

[PATCH 44/44] powerpc: merge __dma_set_mask into dma_set_mask

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig <h...@lst.de> --- arch/powerpc/include/asm/dma-mapping.h | 1 - arch/powerpc/kernel/dma.c | 13 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/a

[PATCH 26/44] dma-mapping: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
And update the documentation - dma_mapping_error has been supported everywhere for a long time. Signed-off-by: Christoph Hellwig <h...@lst.de> --- Documentation/DMA-API-HOWTO.txt | 31 +-- include/linux/dma-mapping.h | 5 - 2 files changed, 5 inse

  1   2   3   4   5   6   7   8   9   10   >