RE: [PATCH V7 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-02-02 Thread Sricharan
Hi, >On 2017-02-01 13:52, Lorenzo Pieralisi wrote: >> >> I debugged the issue and Nate's fix is correct, the fact that you >> can't it hit it with mainline is just a matter of timing because it has >> to do with the CTX pointer value (we OR it with the existing value), so >> it may work or not dep

Re: [PATCH V7 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-02-02 Thread Hanjun Guo
On 02/03/2017 03:01 AM, Nate Watterson wrote: On 2017-02-01 13:52, Lorenzo Pieralisi wrote: I debugged the issue and Nate's fix is correct, the fact that you can't it hit it with mainline is just a matter of timing because it has to do with the CTX pointer value (we OR it with the existing valu

Re: [PATCH V7 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-02-02 Thread Nate Watterson
On 2017-02-01 13:52, Lorenzo Pieralisi wrote: I debugged the issue and Nate's fix is correct, the fact that you can't it hit it with mainline is just a matter of timing because it has to do with the CTX pointer value (we OR it with the existing value), so it may work or not depending on how the

Re: [PATCH v3] arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU

2017-02-02 Thread Geert Uytterhoeven
Hi Robin, On Thu, Feb 2, 2017 at 2:15 PM, Robin Murphy wrote: > On 31/01/17 11:12, Geert Uytterhoeven wrote: >> Add support for allocating physically contiguous DMA buffers on arm64 >> systems with an IOMMU. This can be useful when two or more devices >> with different memory requirements are in

Re: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-02 Thread Mark Rutland
Hi, On Thu, Feb 02, 2017 at 10:40:18PM +0530, Sricharan R wrote: > +- clock-names:Should be a pair of "smmu_iface_clk" and "smmu_bus_clk" > + required for smmu's register group access and interface > + clk for the smmu's underlying bus access. > + > +- clocks:

[PATCH V2 2/3] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device

2017-02-02 Thread Sricharan R
The smmu device probe/remove and add/remove master device callbacks gets called when the smmu is not linked to its master, that is without the context of the master device. So calling runtime apis in those places separately. Signed-off-by: Sricharan R --- drivers/iommu/arm-smmu.c | 45 ++

[PATCH V2 3/3] iommu/arm-smmu: Add the device_link between masters and smmu

2017-02-02 Thread Sricharan R
Finally add the device link between the master device and smmu, so that the smmu gets runtime enabled/disabled only when the master needs it. This is done from add_device callback which gets called once when the master is added to the smmu. Signed-off-by: Sricharan R --- drivers/iommu/arm-smmu.c

[PATCH V2 0/3] iommu/arm-smmu: Add runtime pm/sleep support

2017-02-02 Thread Sricharan R
This series provides the support for turning on the arm-smmu's clocks/power domains using runtime pm. This is done using the recently introduced device links patches, which lets the symmu's runtime to follow the master's runtime pm, so the smmu remains powered only when the masters use it. Took so

[PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-02 Thread Sricharan R
The smmu needs to be functional only when the respective master's using it are active. The device_link feature helps to track such functional dependencies, so that the iommu gets powered when the master device enables itself using pm_runtime. So by adapting the smmu driver for runtime pm, above sai

Re: [RFC 3/3] iommu/arm-smmu: detach DMA domain if driver is managing iommu

2017-02-02 Thread Rob Clark
On Wed, Feb 1, 2017 at 11:10 PM, Sricharan wrote: > Hi Rob, > >>On Wed, Feb 1, 2017 at 10:23 AM, Rob Clark wrote: >>> Before the driver is probed, arm_smmu_add_device() helpfully attaches >>> an IOMMU_DOMAIN_DMA domain. Which ofc does not support stalling, and >>> when the driver later attaches

Re: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-02-02 Thread Will Deacon
On Thu, Feb 02, 2017 at 09:15:19PM +0530, Sricharan wrote: > Hi Rob, > > >-Original Message- > >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] > >On Behalf Of Rob Clark > >Sent: Thursday, February 02, 2017 8:33 PM > >To: Joerg Roedel > >Cc: Will Deacon ; iom

RE: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-02-02 Thread Sricharan
Hi Rob, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Rob Clark >Sent: Thursday, February 02, 2017 8:33 PM >To: Joerg Roedel >Cc: Will Deacon ; iommu@lists.linux-foundation.org; >Sricharan ; linux-arm- >ker...@lists.infra

Re: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-02-02 Thread Will Deacon
On Thu, Feb 02, 2017 at 10:02:50AM -0500, Rob Clark wrote: > On Thu, Jan 26, 2017 at 12:18 PM, Joerg Roedel wrote: > > On Tue, Jan 24, 2017 at 08:42:23PM +0530, Sricharan wrote: > >> Thanks for this series. We had a case with the GPU. > >> The GPU's iommu was setup by kernel and the GPU > >> also

Re: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-02-02 Thread Rob Clark
On Thu, Jan 26, 2017 at 12:18 PM, Joerg Roedel wrote: > On Tue, Jan 24, 2017 at 08:42:23PM +0530, Sricharan wrote: >> Thanks for this series. We had a case with the GPU. >> The GPU's iommu was setup by kernel and the GPU >> also does dynamic updates for on-the-fly switching between >> process page

[PATCH] iommu: mtk: remove bogus 'select' statements

2017-02-02 Thread Arnd Bergmann
The mediatek IOMMU driver enables some drivers that it does not directly rely on, and that causes a warning for build testing: warning: (MTK_IOMMU_V1) selects COMMON_CLK_MT2701_VDECSYS which has unmet direct dependencies (COMMON_CLK && COMMON_CLK_MT2701) warning: (MTK_IOMMU_V1) selects COMMON_CLK

Re: [PATCH v3] arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU

2017-02-02 Thread Robin Murphy
Hi Geert, On 31/01/17 11:12, Geert Uytterhoeven wrote: > Add support for allocating physically contiguous DMA buffers on arm64 > systems with an IOMMU. This can be useful when two or more devices > with different memory requirements are involved in buffer sharing. > > Note that as this uses the

Re: [RFC 3/3] iommu/arm-smmu: detach DMA domain if driver is managing iommu

2017-02-02 Thread Rob Clark
On Wed, Feb 1, 2017 at 11:10 PM, Sricharan wrote: > Hi Rob, > >>On Wed, Feb 1, 2017 at 10:23 AM, Rob Clark wrote: >>> Before the driver is probed, arm_smmu_add_device() helpfully attaches >>> an IOMMU_DOMAIN_DMA domain. Which ofc does not support stalling, and >>> when the driver later attaches