[PATCHv8 6/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-07 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74 inse

[PATCHv8 2/6] dma-debug: add support for resource mappings

2016-06-07 Thread Niklas Söderlund
A MMIO mapped resource can not be represented by a struct page so a new debug type is needed to handle this. This patch add such type and functionality to add/remove entries and how to translate them to a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech

[PATCHv8 4/6] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-06-07 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv8 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-07 Thread Niklas Söderlund
C - Switch to use the dma-mapping api instead of using the iommu_map() directly. Turns out the dma-mapper is much smarter then me... - Dropped the patch to expose domain->ops->pgsize_bitmap from within the iommu api. - Dropped the patch showing how I tested the RFC. Niklas Söderlund (6)

[PATCHv8 1/6] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-06-07 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv8 3/6] dma-mapping: add dma_{map,unmap}_resource

2016-06-07 Thread Niklas Söderlund
Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- Documentation/DMA-API.txt | 22 +- include/linux/dma-mapping.

[PATCHv8 5/6] dmaengine: rcar-dmac: group slave configuration

2016-06-07 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laur

Re: [PATCHv7 4/6] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-06-02 Thread Niklas Söderlund
Hi Russell, Thanks for your feedback. On 2016-06-01 17:16:06 +0100, Russell King - ARM Linux wrote: > On Wed, Jun 01, 2016 at 05:22:27PM +0200, Niklas Söderlund wrote: > > +static dma_addr_t arm_iommu_map_resource(struct device *dev, > > + phys_addr_t phys_ad

Re: [PATCHv7 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-02 Thread Niklas Söderlund
Hi Vinod, On 2016-06-01 23:36:11 +0530, Vinod Koul wrote: > On Wed, Jun 01, 2016 at 05:22:23PM +0200, Niklas Söderlund wrote: > > Hi, > > > > [In this v7 series I have tried to address the questions raised by > > Christoph > > Hellwig and I hope it can awnser y

[PATCHv7 3/6] dma-mapping: add dma_{map,unmap}_resource

2016-06-01 Thread Niklas Söderlund
Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- Documentation/DMA-API.txt | 22 +- include/linux/dma-mapping.

[PATCHv7 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-01 Thread Niklas Söderlund
p() directly. Turns out the dma-mapper is much smarter then me... - Dropped the patch to expose domain->ops->pgsize_bitmap from within the iommu api. - Dropped the patch showing how I tested the RFC. Niklas Söderlund (6): dma-mapping: add {map,unmap}_resource to dma_map_ops dma-debug: ad

[PATCHv7 1/6] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-06-01 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv7 2/6] dma-debug: add support for resource mappings

2016-06-01 Thread Niklas Söderlund
A MMIO mapped resource can not be represented by a struct page so a new debug type is needed to handle this. This patch add such type and functionality to add/remove entries and how to translate them to a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech

[PATCHv7 4/6] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-06-01 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv7 5/6] dmaengine: rcar-dmac: group slave configuration

2016-06-01 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laur

[PATCHv7 6/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-01 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74 inse

Re: [PATCHv8 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-16 Thread Niklas Söderlund
Hi Russell, I was wondering if you have time to look at this series? Especially patch 4/6 which you had some good review comments on in v7. On 2016-06-07 09:54:07 +0200, Niklas Söderlund wrote: > Hi, > > This series tries to solve the problem with DMA with device registers > (MM

Re: [PATCH v3 7/8] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-02-12 Thread Niklas Söderlund
Hi Simon, * Simon Horman [2016-02-10 18:55:59 +0100]: > Hi Niklas, > > I am deferring accepting this and the similar patch for the r8a7791 pending > acceptance of the driver changes earlier in this series. Please let me know > if you prefer a different course of action.

[PATCH v3 4/8] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-02-09 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- arch/arm/mm/dma-mapping.

[PATCH v3 2/8] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-02-09 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to map be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- include/linux/dma-mapping.h | 6 ++ 1 file chan

[PATCH v3 8/8] ARM: dts: r8a7791: add iommus to dmac0 and dmac1

2016-02-09 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- arch/arm/boot/dts/r8a7791.dtsi | 30 ++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi index 2a369dd..6dff061 100644 ---

[PATCH v3 3/8] dma-mapping: add dma_{map,unmap}_resource

2016-02-09 Thread Niklas Söderlund
Map/Unmap a device resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- include/linux/dma-mapping.h | 27 +++ 1 file changed, 27 insertions(+)

[PATCH v3 1/8] iommu: Add MMIO mapping type

2016-02-09 Thread Niklas Söderlund
From: Robin Murphy On some platforms, MMIO regions might need slightly different treatment compared to mapping regular memory; add the notion of MMIO mappings to the IOMMU API's memory type flags, so that callers can let the IOMMU drivers know to do the right thing.

[PATCH v3 5/8] dmaengine: rcar-dmac: group slave configuration

2016-02-09 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.

[PATCH v3 7/8] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-02-09 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- arch/arm/boot/dts/r8a7790.dtsi | 30 ++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi index 7dfd393..048bbf8 100644 ---

[PATCH v3 6/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-02-09 Thread Niklas Söderlund
Enable slave transfers to devices behind IPMMU:s by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.c | 57 ++ 1 file changed, 52 inse

[PATCH v3 0/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-02-09 Thread Niklas Söderlund
how I tested the RFC. Niklas Söderlund (7): dma-mapping: add {map,unmap}_resource to dma_map_ops dma-mapping: add dma_{map,unmap}_resource arm: dma-mapping: add {map,unmap}_resource for iommu ops dmaengine: rcar-dmac: group slave configuration dmaengine: rcar-dmac: add iommu support for

Re: [PATCH v3 1/8] iommu: Add MMIO mapping type

2016-02-16 Thread Niklas Söderlund
Pinchart wrote: > >Hi Niklas, > > > >Thank you for the patch. > > > >On Wednesday 10 February 2016 01:57:51 Niklas Söderlund wrote: > >>From: Robin Murphy <robin.mur...@arm.com> > >> > >>On some platforms, MMIO regions might need

Re: [PATCH v3 1/8] iommu: Add MMIO mapping type

2016-02-16 Thread Niklas Söderlund
* Robin Murphy <robin.mur...@arm.com> [2016-02-16 12:43:40 +]: > On 16/02/16 12:06, Niklas Söderlund wrote: > >Hi Robin, > > > >Thanks for your update patch I will include it in my next version. But > >I'm sorry I do not understand, is your modification

[PATCH v4 7/8] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-02-16 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Acked-by: L

[PATCH v4 6/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-02-16 Thread Niklas Söderlund
Enable slave transfers to devices behind IPMMU:s by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> --- drivers/dma/sh/rcar

[PATCH v4 5/8] dmaengine: rcar-dmac: group slave configuration

2016-02-16 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laur

[PATCH v4 4/8] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-02-16 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCH v4 3/8] dma-mapping: add dma_{map,unmap}_resource

2016-02-16 Thread Niklas Söderlund
Map/Unmap a device resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- include/linux/dma-mapping.h | 32 1 file changed, 32 inse

[PATCH v4 2/8] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-02-16 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCH v4 0/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-02-16 Thread Niklas Söderlund
since RFC - Switch to use the dma-mapping api instead of using the iommu_map() directly. Turns out the dma-mapper is much smarter then me... - Dropped the patch to expose domain->ops->pgsize_bitmap from within the iommu api. - Dropped the patch showing how I tested the RFC. Niklas Söd

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

2016-03-11 Thread Niklas Söderlund
ddr_t to a dma_addr_t using something like this. Is it not very similar to dma_map_single() where one maps processor virtual memory (instead if MMIO) so that it can be used with DMA slaves? -- Regards, Niklas Söderlund ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH v5 7/9] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-03-07 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74 inse

[PATCH v5 9/9] ARM: dts: r8a7791: add iommus to dmac0 and dmac1

2016-03-07 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Acked-by: L

[PATCH v5 6/9] dmaengine: rcar-dmac: group slave configuration

2016-03-07 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.

[PATCH v5 0/9] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-03-07 Thread Niklas Söderlund
ropped the patch showing how I tested the RFC. Niklas Söderlund (8): dma-mapping: add {map,unmap}_resource to dma_map_ops dma-mapping: add dma_{map,unmap}_resource arm: dma-mapping: add {map,unmap}_resource for iommu ops dmaengine: rcar-dmac: slave address are physical dmaengine: rcar-dmac:

[PATCH v5 5/9] dmaengine: rcar-dmac: slave address are physical

2016-03-07 Thread Niklas Söderlund
Slave addresses coming from a client is physical not dma. Store the address using the correct data type. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac

[PATCH v5 4/9] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-03-07 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCH v5 1/9] iommu: Add MMIO mapping type

2016-03-07 Thread Niklas Söderlund
Signed-off-by: Robin Murphy <robin.mur...@arm.com> Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/iommu/io-pgtable-arm.c | 9 +++-- include/linux/iommu.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/iomm

[PATCH v5 8/9] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-03-07 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Acked-by: L

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

2016-03-07 Thread Niklas Söderlund
Map/Unmap a device resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- include/linux/dma-mapping.h | 32 1 file changed, 32 inse

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

2016-04-25 Thread Niklas Söderlund
or(). With that I can't see how a dma_addr_t would end up in lib/dma-debug.c. But I might be missing something? In the big picture do you feel the approach I have is the correct way to solve my problem? Provided we can work out this issues ofc? -- Regards, Niklas Söderlund

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

2016-04-26 Thread Niklas Söderlund
debug.c. I will see if I can make the dma_mapping_error() safe to use with a dma_addr_t obtained from dma_map_resource() and post a new series. Thanks for pointing this out! -- Regards, Niklas Söderlund ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCHv6 2/8] dma-debug: add support for resource mappings

2016-05-19 Thread Niklas Söderlund
gt; > > > + entry->size = size; > > + entry->dev_addr = dma_addr; > > + entry->direction = direction; > > + entry->map_err_type = MAP_ERR_NOT_CHECKED; > > + > > + add_dma_entry(entry); > > +} > > +EXPO

Re: [PATCHv6 3/8] dma-mapping: add dma_{map,unmap}_resource

2016-05-19 Thread Niklas Söderlund
ce() (which is added in this patch) as one of the calls which return dma_addr_t should be checked for error using dma_mapping_error(). But yes the change effect all lines in the paragraph due to line wrapping. Hum or maybe I'm misunderstanding your question. -- Regards, Niklas Söderlu

[PATCH 1/2] dma-mapping: add __dma_sync_single_for_device()

2016-05-08 Thread Niklas Söderlund
() so the new mapping can't be found and are believed to be invalid. Add __dma_sync_single_for_device() that don't call into debug_dma_sync_single_for_device() and can be used in these situations. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- include/linux/dma-map

[PATCH 0/2] Fix incorrect warning from dma-debug

2016-05-08 Thread Niklas Söderlund
[] (kernel_init+0x10/0x118) r9:[1.879529] ata1: link resume succeeded after 1 retries r8: r7: r6: r5:c071066c r4: [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) r5:c071066c r4: ---[ end trace 6eb9a3df3009d491 ]--- Niklas Söderlund (2): dma

[PATCH 2/2] iommu/io-pgtable-arm: use __dma_sync_single_for_device()

2016-05-08 Thread Niklas Söderlund
and a warning is printed. Avoid this warning by calling __dma_sync_single_for_device() which don't preform this check. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/iommu/io-pgtable-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCHv6 1/8] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-05-09 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv6 0/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-05-09 Thread Niklas Söderlund
hanges since RFC - Switch to use the dma-mapping api instead of using the iommu_map() directly. Turns out the dma-mapper is much smarter then me... - Dropped the patch to expose domain->ops->pgsize_bitmap from within the iommu api. - Dropped the patch showing how I tested the RFC. Niklas Sö

[PATCHv6 2/8] dma-debug: add support for resource mappings

2016-05-09 Thread Niklas Söderlund
A MMIO mapped resource can not be represented by a struct page so a new debug type is needed to handle this. This patch add such type and functionality to add/remove entries and how to translate them to a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech

[PATCHv6 7/8] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-05-09 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Acked-by: L

[PATCHv6 3/8] dma-mapping: add dma_{map,unmap}_resource

2016-05-09 Thread Niklas Söderlund
Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- Documentation/DMA-API.txt | 22 +- include/linux/dma-mapping.

[PATCHv6 4/8] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-05-09 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv6 5/8] dmaengine: rcar-dmac: group slave configuration

2016-05-09 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laur

[PATCHv6 6/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-05-09 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74 inse

[PATCHv6 8/8] ARM: dts: r8a7791: add iommus to dmac0 and dmac1

2016-05-09 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Acked-by: L

[PATCHv9 5/6] dmaengine: rcar-dmac: group slave configuration

2016-08-10 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laur

[PATCHv9 3/6] dma-mapping: add dma_{map,unmap}_resource

2016-08-10 Thread Niklas Söderlund
Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- Documentation/DMA-API.txt | 22 +- include/linux/dma-mapping.

[PATCHv9 6/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-08-10 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74 inse

[PATCHv9 1/6] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-08-10 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

[PATCHv9 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-08-10 Thread Niklas Söderlund
n for r8a7791. * Changes since RFC - Switch to use the dma-mapping api instead of using the iommu_map() directly. Turns out the dma-mapper is much smarter then me... - Dropped the patch to expose domain->ops->pgsize_bitmap from within the iommu api. - Dropped the patch showing how I teste

[PATCHv9 2/6] dma-debug: add support for resource mappings

2016-08-10 Thread Niklas Söderlund
A MMIO mapped resource can not be represented by a struct page so a new debug type is needed to handle this. This patch add such type and functionality to add/remove entries and how to translate them to a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech

[PATCHv9 4/6] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-08-10 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideason

Re: [PATCHv9 4/6] arm: dma-mapping: add {map,unmap}_resource for iommu ops

2016-08-23 Thread Niklas Söderlund
Hi Russell, If you have the time can you please have a look at this patch? This series have been out for some time now and Vinod is willing to take it through the dmaengine tree but a ACK is needed on this patch from you first. On 2016-08-10 13:22:17 +0200, Niklas Söderlund wrote: >

[PATCH] dma-debug: fix ia64 build, use PHYS_PFN

2016-09-29 Thread Niklas Söderlund
ia64 does not provide __phys_to_pfn(), use the PHYS_PFN() alias. Fixes: 0e74b34dfc3318bf ("dma-debug: add support for resource mappings") Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> --- lib/dma-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 de

Re: [PATCHv9 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-09-23 Thread Niklas Söderlund
Hi Vinod, On 2016-09-15 21:56:51 +0530, Vinod Koul wrote: > On Wed, Aug 10, 2016 at 11:07:10PM +0530, Vinod Koul wrote: > > On Wed, Aug 10, 2016 at 01:22:13PM +0200, Niklas Söderlund wrote: > > > Hi, > > > > > > This series tries to solve the problem with D

[PATCH 2/2] dma-mapping: fix m32r build warning

2016-09-29 Thread Niklas Söderlund
From: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> kbuild test robot reports: In file included from include/linux/skbuff.h:34:0, from include/linux/icmpv6.h:4, from include/linux/ipv6.h:75, from include/net/ipv

[PATCH 1/2] dma-mapping: fix ia64 build, use PHYS_PFN

2016-09-29 Thread Niklas Söderlund
From: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> kbuild test robot reports: In file included from include/linux/skbuff.h:34:0, from include/linux/tcp.h:21, from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:119: include/linux/dma-map

[PATCH 0/2] dma-mapping: fix ia64 and m32r build error and warnings

2016-09-29 Thread Niklas Söderlund
From: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> Hi Vindo, This small series fixes the build error and warnings for ia64 and m32r which kbuild test robot found and where introduced in the series '[PATCHv9 0/6] dmaengine: rcar-dmac: add iommu support for slave tra

Re: [PATCH 0/2] dma-mapping: fix ia64 and m32r build error and warnings

2016-09-29 Thread Niklas Söderlund
On 2016-09-29 17:40:04 +0530, Vinod Koul wrote: > On Thu, Sep 29, 2016 at 12:02:38PM +0200, Niklas Söderlund wrote: > > From: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se> > > > > Hi Vindo, > > :( I'm sorry, my hands sometimes moves faster then my hea

Re: [PATCHv9 6/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2017-01-09 Thread Niklas Söderlund
Hi Laurent, On 2017-01-02 01:08:04 +0200, Laurent Pinchart wrote: > Hi Niklas, > > On Monday 05 Sep 2016 12:52:44 Laurent Pinchart wrote: > > On Wednesday 10 Aug 2016 13:22:19 Niklas Söderlund wrote: > > > Enable slave transfers to a device behind a IPMMU by mapping t

[PATCH] dma-mapping: fix return type of dma_set_max_seg_size()

2018-08-29 Thread Niklas Söderlund
The function dma_set_max_seg_size() can return either 0 on success or -EIO on error. Change its return type from unsigned int to int to capture this. Signed-off-by: Niklas Söderlund --- include/linux/dma-mapping.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include

Re: [PATCH] dma-mapping: fix return type of dma_set_max_seg_size()

2018-11-02 Thread Niklas Söderlund
Hi, A gentle ping on this patch. On 2018-08-29 23:29:21 +0200, Niklas Söderlund wrote: > The function dma_set_max_seg_size() can return either 0 on success or > -EIO on error. Change its return type from unsigned int to int to > capture this. > > Signed-off-by: N

Re: [PATCH] dma-mapping: fix return type of dma_set_max_seg_size()

2018-11-26 Thread Niklas Söderlund
On 2018-11-02 11:22:54 +0100, Niklas Söderlund wrote: > Hi, > > A gentle ping on this patch. A slightly harder ping :-) > > On 2018-08-29 23:29:21 +0200, Niklas Söderlund wrote: > > The function dma_set_max_seg_size() can return either 0 on success or > > -EIO on er

Re: [PATCH v3 2/6] iommu/ipmmu-vmsa: tidyup register definitions

2019-11-06 Thread Niklas Söderlund
SoC families they apply > - Add categories about MMU "context" and uTLB registers > > No change behavior. > > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 58 >

Re: [PATCH v3 3/6] iommu/ipmmu-vmsa: Add helper functions for MMU "context" registers

2019-11-06 Thread Niklas Söderlund
ge. > > Signed-off-by: Yoshihiro Shimoda > Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 32 +++- > 1 file changed, 23 insertions(+), 9 deletions(-) > > diff --git a/drivers/iommu/ipmmu-

Re: [PATCH v3 1/6] iommu/ipmmu-vmsa: Remove all unused register definitions

2019-11-06 Thread Niklas Söderlund
IMUCTR_FIXADD_MASK (0xff << 16) > -#define IMUCTR_FIXADD_SHIFT 16 > #define IMUCTR_TTSEL_MMU(n) ((n) << 4) > -#define IMUCTR_TTSEL_PMB (8 << 4) > -#define IMUCTR_TTSEL_MASK(15 << 4) > #define IMUCTR_FLUSH (1 << 1) > #define IMUCTR_MMUEN (1 << 0) > > #define IMUASID(n) ((n) < 32 ? IMUASID0(n) : IMUASID32(n)) > #define IMUASID0(n) (0x0308 + ((n) * 16)) > #define IMUASID32(n) (0x0608 + (((n) - 32) * 16)) > -#define IMUASID_ASID8_MASK (0xff << 8) > -#define IMUASID_ASID8_SHIFT 8 > -#define IMUASID_ASID0_MASK (0xff << 0) > -#define IMUASID_ASID0_SHIFT 0 > > /* > - > * Root device handling > -- > 2.7.4 > -- Regards, Niklas Söderlund ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 5/6] iommu/ipmmu-vmsa: Add helper functions for "uTLB" registers

2019-11-06 Thread Niklas Söderlund
No behavior change. > > Signed-off-by: Yoshihiro Shimoda > Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 26 +- > 1 file changed, 21 insertions(+), 5 deletions(-) > > diff --git a/drivers/iomm

Re: [PATCH v3 6/6] iommu/ipmmu-vmsa: Add utlb_offset_base

2019-11-06 Thread Niklas Söderlund
or change. > > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > index 82da486..c813436 100644 &

Re: [PATCH v3 4/6] iommu/ipmmu-vmsa: Calculate context registers' offset instead of a macro

2019-11-06 Thread Niklas Söderlund
or change. > > Signed-off-by: Yoshihiro Shimoda > Reviewed-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmm

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Add utlb_offset_base

2019-10-09 Thread Niklas Söderlund
avior change. > > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 14 +++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c > index 76fb250..

Re: [PATCH 1/3] iommu/ipmmu-vmsa: Remove some unused register declarations

2019-10-09 Thread Niklas Söderlund
16 > #define IMUCTR_TTSEL_MMU(n) ((n) << 4) > -#define IMUCTR_TTSEL_PMB (8 << 4) > -#define IMUCTR_TTSEL_MASK(15 << 4) > #define IMUCTR_FLUSH (1 << 1) > #define IMUCTR_MMUEN (1 << 0) > > -- > 2.7.4 > -- Regards, Niklas Söderlund

Re: [PATCH 2/3] iommu/ipmmu-vmsa: Calculate context registers' offset instead of a macro

2019-10-09 Thread Niklas Söderlund
or change. > > Signed-off-by: Yoshihiro Shimoda Reviewed-by: Niklas Söderlund > --- > drivers/iommu/ipmmu-vmsa.c | 27 +++ > 1 file changed, 19 insertions(+), 8 deletions(-) > > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c &