Re: [PATCH v5 1/6] base: power: runtime: Export pm_runtime_get/put_suppliers

2018-01-11 Thread Vivek Gautam
On 01/12/2018 04:23 AM, Rafael J. Wysocki wrote: On Tue, Jan 9, 2018 at 11:01 AM, Vivek Gautam wrote: The device link allows the pm framework to tie the supplier and consumer. So, whenever the consumer is powered-on the supplier is powered-on first. There are

Re: [PATCH v5 5/6] iommu/arm-smmu: Add support for qcom,smmu-v2 variant

2018-01-11 Thread Vivek Gautam
Hi Rob, On 01/12/2018 03:53 AM, Rob Herring wrote: On Tue, Jan 09, 2018 at 03:31:48PM +0530, Vivek Gautam wrote: qcom,smmu-v2 is an arm,smmu-v2 implementation with specific clock and power requirements. This smmu core is used with multiple masters on msm8996, viz. mdss, video, etc. Add

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread JeffyChen
Hi Robin, Thnaks for your reply. On 01/11/2018 08:24 PM, Robin Murphy wrote: Hi Jeffy, On 11/01/18 11:14, JeffyChen wrote: Hi Marek, Thanks for your reply. On 01/11/2018 05:40 PM, Marek Szyprowski wrote: Hi Jeffy, On 2018-01-11 09:22, Jeffy Chen wrote: With the probe-deferral mechanism,

Re: [PATCH 2/9] iommu/rockchip: Fix error handling in attach

2018-01-11 Thread JeffyChen
Hi Robin, thanks for your reply. On 01/11/2018 11:47 PM, Robin Murphy wrote: +for (i = 0; i < iommu->num_irq; i++) { +ret = devm_request_irq(iommu->dev, iommu->irq[i], rk_iommu_irq, + IRQF_SHARED, dev_name(dev), iommu); Why aren't we simply requesting the

Re: [PATCH v5 5/6] iommu/arm-smmu: Add support for qcom,smmu-v2 variant

2018-01-11 Thread Rob Herring
On Tue, Jan 09, 2018 at 03:31:48PM +0530, Vivek Gautam wrote: > qcom,smmu-v2 is an arm,smmu-v2 implementation with specific > clock and power requirements. This smmu core is used with > multiple masters on msm8996, viz. mdss, video, etc. > Add bindings for the same. > > Signed-off-by: Vivek

Re: [PATCH v3 08/16] iommu: introduce device fault data

2018-01-11 Thread Jacob Pan
On Wed, 10 Jan 2018 11:41:58 + Jean-Philippe Brucker wrote: > Hi Jacob, > > On 17/11/17 18:55, Jacob Pan wrote: > [...] > > +/** > > + * struct iommu_fault_event - Generic per device fault data > > + * > > + * - PCI and non-PCI devices > > + * - Recoverable

Re: [PATCH 2/9] iommu/rockchip: Fix error handling in attach

2018-01-11 Thread Robin Murphy
On 11/01/18 08:22, Jeffy Chen wrote: From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Marek Szyprowski
Hi Jeffy, On 2018-01-11 12:14, JeffyChen wrote: Hi Marek, Thanks for your reply. On 01/11/2018 05:40 PM, Marek Szyprowski wrote: Hi Jeffy, On 2018-01-11 09:22, Jeffy Chen wrote: With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Robin Murphy
Hi Jeffy, On 11/01/18 11:14, JeffyChen wrote: Hi Marek, Thanks for your reply. On 01/11/2018 05:40 PM, Marek Szyprowski wrote: Hi Jeffy, On 2018-01-11 09:22, Jeffy Chen wrote: With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread JeffyChen
Hi Marek, Thanks for your reply. On 01/11/2018 05:40 PM, Marek Szyprowski wrote: Hi Jeffy, On 2018-01-11 09:22, Jeffy Chen wrote: With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Marek Szyprowski
Hi Jeffy, On 2018-01-11 09:22, Jeffy Chen wrote: With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- drivers/iommu/arm-smmu-v3.c | 2 +-

[PATCH 9/9] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-11 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 13 + 1 file changed, 13

[PATCH 8/9] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-11 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 96 -- 1 file

[PATCH 7/9] iommu/rockchip: Use iommu_group_get_for_dev() for add_device

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa IOMMU drivers are supposed to call this function instead of manually creating a group in their .add_device callback. This behavior is not strictly required by ARM DMA mapping implementation, but ARM64 already relies on it. This patch fixes the rockchip-iommu

[PATCH 6/9] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen

[PATCH 5/9] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen

[PATCH 4/9] iommu/rockchip: Fix error handling in init

2018-01-11 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of init call. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git

[PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Jeffy Chen
With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- drivers/iommu/arm-smmu-v3.c | 2 +- drivers/iommu/arm-smmu.c | 12 ++--

[PATCH 2/9] iommu/rockchip: Fix error handling in attach

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa

[PATCH 3/9] iommu/rockchip: Fix error handling in probe

2018-01-11 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index

[PATCH 0/9] iommu/rockchip: Use OF_IOMMU

2018-01-11 Thread Jeffy Chen
This series fixes some issues in rockchip iommu driver, and add of_iommu support in it. Also drop of_iommu early initialisation hooks as Robin suggested. Jeffy Chen (5): iommu/of: Drop early initialisation hooks iommu/rockchip: Fix error handling in probe iommu/rockchip: Fix error