Re: [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM

2014-12-14 Thread Tomasz Figa
On Sat, Dec 13, 2014 at 5:47 AM, Laurent Pinchart wrote: > Hello, > > On Friday 12 December 2014 13:15:51 Tomasz Figa wrote: >> On Fri, Dec 12, 2014 at 5:48 AM, Rafael J. Wysocki wrote: >> > On Thursday, December 11, 2014 04:51:37 PM Ulf Hansson wrote: >> >> On 11 December 2014 at 16:31, Kevin Hil

Re: [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM

2014-12-14 Thread Tomasz Figa
On Sat, Dec 13, 2014 at 5:04 AM, Kevin Hilman wrote: > Tomasz Figa writes: > > [...] > >> We have a power domain, which contains an IOMMU and an IP block, which >> can do bus transactions through that IOMMU. Of course the IP block is >> not aware of the IOMMU, because this is just an integration

[PATCH/RFC] iommu/ipmmu-vmsa: Use DT-based instantiation

2014-12-14 Thread Laurent Pinchart
Signed-off-by: Laurent Pinchart --- drivers/iommu/ipmmu-vmsa.c | 243 + 1 file changed, 93 insertions(+), 150 deletions(-) Hi Will, This patch is a proof of concept of the Renesas IPMMU-VMSA driver integration with the DMA mapping core. The code is ba

[PATCH 10/10] ARM: shmobile: r8a7791: Add IPMMU DT nodes

2014-12-14 Thread Laurent Pinchart
Add the seven IPMMU instances found in the r8a7791 to DT with a disabled status. Signed-off-by: Laurent Pinchart --- arch/arm/boot/dts/r8a7791.dtsi | 56 ++ 1 file changed, 56 insertions(+) diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r

[PATCH 08/10] iommu/ipmmu-vmsa: Remove platform data support

2014-12-14 Thread Laurent Pinchart
No board file instantiates the IPMMU using platform data. Now that we have DT support, get rid of platform data. Signed-off-by: Laurent Pinchart --- drivers/iommu/ipmmu-vmsa.c | 24 include/linux/platform_data/ipmmu-vmsa.h | 24 2 f

[PATCH 09/10] ARM: shmobile: r8a7790: Add IPMMU DT nodes

2014-12-14 Thread Laurent Pinchart
Add the six IPMMU instances found in the r8a7790 to DT with a disabled status. Signed-off-by: Laurent Pinchart --- arch/arm/boot/dts/r8a7790.dtsi | 48 ++ 1 file changed, 48 insertions(+) diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a

[PATCH 05/10] iommu/ipmmu-vmsa: Add device tree bindings documentation

2014-12-14 Thread Laurent Pinchart
Signed-off-by: Laurent Pinchart --- .../bindings/iommu/renesas,ipmmu-vmsa.txt | 37 ++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt Cc: devicet...@vger.kernel.org diff --git a/Documentation/devi

[PATCH 07/10] iommu/ipmmu-vmsa: Support multiple micro TLBs per device

2014-12-14 Thread Laurent Pinchart
Devices such as the system DMA controller are connected to multiple micro TLBs of the same IOMMU. Support this. Selective enabling of micro TLBs based on runtime device usage isn't possible at the moment due to lack of support in the IOMMU and DMA mapping APIs. Support for devices connected to dif

[PATCH 06/10] iommu/ipmmu-vmsa: Add device tree support

2014-12-14 Thread Laurent Pinchart
Make platform data optional when the device is instantiated from DT and look up the micro-TLB number in the bus master DT node. Signed-off-by: Laurent Pinchart --- drivers/iommu/ipmmu-vmsa.c | 39 +++ 1 file changed, 31 insertions(+), 8 deletions(-) Cc: devic

[PATCH 02/10] iommu/ipmmu-vmsa: Flush P[UM]D entry before freeing the child page table

2014-12-14 Thread Laurent Pinchart
When clearing PUD or PMD entries the child page table (if any) is freed and the PUD or PMD entry is then cleared. This result in a small race condition window during which a free page table could be accessed by the IPMMU. Fix it by clearing and flushing the PUD or PMD entry before freeing the chil

[PATCH 03/10] iommu/ipmmu-vmsa: Invalidate TLB after unmapping

2014-12-14 Thread Laurent Pinchart
The TLB must be invalidated after unmapping memory to remove stale TLB entries. this was supposed to be performed already, but a bug in the driver prevented the TLB invalidate function from being called. Fix it. Signed-off-by: Laurent Pinchart --- drivers/iommu/ipmmu-vmsa.c | 4 +--- 1 file chan

[PATCH 01/10] iommu/ipmmu-vmsa: Cleanup failures of ARM mapping creation or attachment

2014-12-14 Thread Laurent Pinchart
The ARM IOMMU mapping needs to be released when attaching the device fails. Add arm_iommu_release_mapping() to the error code path. This is safe to call with a NULL mapping, so no specific check is needed. Cleanup is also missing when failing to create a mapping. Jump to the error code path in tha

[PATCH 04/10] iommu/ipmmu-vmsa: Return proper error if devm_request_irq fails

2014-12-14 Thread Laurent Pinchart
From: Axel Lin Signed-off-by: Axel Lin Signed-off-by: Laurent Pinchart --- drivers/iommu/ipmmu-vmsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 9838d119045d..70bb5ba2aa51 100644 --- a/drivers/iommu/ipmmu-vm

[PATCH 00/10] Renesas IPMMU-VMSA fixes and DT support

2014-12-14 Thread Laurent Pinchart
Hello, This patch fixes several small issues with the Renesas IPMMU-VMSA driver and then implements DT support. Patches 01/10 to 04/10 are small bug fixes. Please see the individual patches for more information. Patches 05/10 and 06/10 define DT bindings and implement DT support. Patches 07/10 a

Re: [PATCH 0/4] Generic IOMMU page table framework

2014-12-14 Thread Laurent Pinchart
Hi Will, On Thursday 27 November 2014 11:51:14 Will Deacon wrote: > Hi all, > > This series introduces a generic IOMMU page table allocation framework, > implements support for ARM long-descriptors and then ports the arm-smmu > driver over to the new code. > > There are a few reasons for doing t

Re: [PATCH 1/4] iommu: introduce generic page table allocation framework

2014-12-14 Thread Laurent Pinchart
Hi Will, Please see below for another small comment. On Thursday 27 November 2014 11:51:15 Will Deacon wrote: > This patch introduces a generic framework for allocating page tables for > an IOMMU. There are a number of reasons we want to do this: > > - It avoids duplication of complex table ma

RE: [PATCH 2/4] iommu: add ARM LPAE page table allocator

2014-12-14 Thread Varun Sethi
Hi Will, Please find my response inline. Search for "varun". -Original Message- From: Will Deacon [mailto:will.dea...@arm.com] Sent: Saturday, December 06, 2014 12:18 AM To: Sethi Varun-B16395 Cc: linux-arm-ker...@lists.infradead.org; iommu@lists.linux-foundation.org; prem.malla...@broad

Re: [PATCH v6 6/8] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-12-14 Thread Laurent Pinchart
Hi Will, On Sunday 14 December 2014 17:49:34 Laurent Pinchart wrote: > On Wednesday 10 December 2014 15:08:53 Will Deacon wrote: > > On Wed, Dec 10, 2014 at 02:52:56PM +, Rob Clark wrote: > > > On Mon, Dec 1, 2014 at 11:57 AM, Will Deacon wrote: > > > > This patch extends of_dma_configure so t

Re: [PATCH v6 6/8] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-12-14 Thread Laurent Pinchart
Hi Will, On Monday 01 December 2014 16:57:12 Will Deacon wrote: > This patch extends of_dma_configure so that it sets up the IOMMU for a > device, as well as the coherent/non-coherent DMA mapping ops. > > Acked-by: Arnd Bergmann > Acked-by: Marek Szyprowski > Tested-by: Robin Murphy > Signed-o

Re: [PATCH v6 6/8] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-12-14 Thread Laurent Pinchart
Hi Will, On Wednesday 10 December 2014 15:08:53 Will Deacon wrote: > On Wed, Dec 10, 2014 at 02:52:56PM +, Rob Clark wrote: > > On Mon, Dec 1, 2014 at 11:57 AM, Will Deacon wrote: > > > This patch extends of_dma_configure so that it sets up the IOMMU for a > > > device, as well as the coheren

Re: [PATCH v3 18/19] iommu: exynos: init from dt-specific callback instead of initcall

2014-12-14 Thread Laurent Pinchart
Hi Marek, Thank you for the patch. On Wednesday 19 November 2014 12:15:47 Marek Szyprowski wrote: > This patch introduces IOMMU_OF_DECLARE-based initialization to the > driver, which replaces subsys_initcall-based procedure. > exynos_iommu_of_setup ensures that each sysmmu controller is probed >