[PATCH 2/3] ARM: dts: r8a7743: Add IPMMU DT nodes

2018-01-24 Thread Biju Das
Add the six IPMMU instances found in the r8a7743 to DT with a disabled status. Signed-off-by: Biju Das Reviewed-by: Chris Paterson --- arch/arm/boot/dts/r8a7743.dtsi | 58 ++ 1 file changed, 58

[PATCH 3/3] ARM: dts: r8a7745: Add IPMMU DT nodes

2018-01-24 Thread Biju Das
Add the six IPMMU instances found in the r8a7745 to DT with a disabled status. Signed-off-by: Biju Das Reviewed-by: Chris Paterson --- arch/arm/boot/dts/r8a7745.dtsi | 58 ++ 1 file changed, 58

[PATCH 1/3] dt-bindings: iommu: ipmmu-vmsa: Add device tree support for r8a774[35]

2018-01-24 Thread Biju Das
Document r8a774[35] specific compatible strings. The Renesas RZ/G1[ME] (r8a774[35]) IPMMU are identical to the R-Car Gen2 family. Signed-off-by: Biju Das Reviewed-by: Chris Paterson ---

[PATCH 0/3] Add IPMMU support for r8a774[35]

2018-01-24 Thread Biju Das
This patch series aims to add IPMMU support for r8a774[35] SoC. It is tested with modetest utility and the patches present in the below git for enabling ipmmu support in the vsp1 and DU. git://linuxtv.org/pinchartl/media.git iommu/devel/dt It is tested against renesas-devel-20180122-v4.15-rc9

Re: [PATCH 1/3] dt-bindings: iommu: ipmmu-vmsa: Add device tree support for r8a774[35]

2018-01-24 Thread Geert Uytterhoeven
On Wed, Jan 24, 2018 at 4:42 PM, Biju Das wrote: > Document r8a774[35] specific compatible strings. The Renesas RZ/G1[ME] > (r8a774[35]) IPMMU are identical to the R-Car Gen2 family. > > Signed-off-by: Biju Das > Reviewed-by: Chris Paterson

Re: [PATCH v2] iommu/mediatek: Move attach_device after iommu-group is ready for M4Uv1

2018-01-24 Thread Robin Murphy
On 23/01/18 08:39, Yong Wu wrote: In the commit 05f80300dc8b ("iommu: Finish making iommu_group support mandatory"), the iommu framework has supposed all the iommu drivers have their owner iommu-group, it get rid of the FIXME workarounds while the group is NULL. But the flow of Mediatek M4U gen1

[PATCH] iommu/exynos: Use generic group callback

2018-01-24 Thread Robin Murphy
Since iommu_group_get_for_dev() already tries iommu_group_get() and will not call ops->device_group if the group is already non-NULL, the check in get_device_iommu_group() is always redundant and it reduces to a duplicate of the generic version; let's just use that one instead. Signed-off-by:

Re: [PATCH v5 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-24 Thread Robin Murphy
On 24/01/18 10:35, Jeffy Chen wrote: From: Tomasz Figa Current code relies on master driver enabling necessary clocks before IOMMU is accessed, however there are cases when the IOMMU should be accessed while the master is not running yet, for example allocating V4L2

[PATCH 2/5] iommu/intel: Clean/document fault status flags

2018-01-24 Thread Dmitry Safonov via iommu
So one could decode them without opening the specification. Signed-off-by: Dmitry Safonov --- include/linux/intel-iommu.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index

[PATCH 4/5] iommu/intel: Handle DMAR faults on workqueue

2018-01-24 Thread Dmitry Safonov via iommu
dmar_fault() reports/handles/cleans DMAR faults in a cycle one-by-one. The nuisance is that it's set as a irq handler and runs with disabled interrupts - which works OK if you have only a couple of DMAR faults, but becomes a problem if your intel iommu has a plenty of mappings. We have a test

[PATCH 0/5] iommu/intel: Handle DMAR faults in a wq

2018-01-24 Thread Dmitry Safonov via iommu
A softlockup-panic fix I've meet on kernel test suite. While at it, fix a couple of minor issues. Cc: Alex Williamson Cc: David Woodhouse Cc: Ingo Molnar Cc: Joerg Roedel Cc: Lu Baolu

[PATCH 3/5] iommu/intel: Introduce clear_primary_faults() helper

2018-01-24 Thread Dmitry Safonov via iommu
To my mind it's a bit more readable - and I will re-use it in the next patch. Signed-off-by: Dmitry Safonov --- drivers/iommu/dmar.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index

[PATCH 1/5] iommu/intel: Add __init for dmar_register_bus_notifier()

2018-01-24 Thread Dmitry Safonov via iommu
It's called only from intel_iommu_init(), which is init function. Signed-off-by: Dmitry Safonov --- drivers/iommu/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 9a7ffd13c7f0..accf58388bdb 100644 ---

[PATCH 5/5] iommu/intel: Rename dmar_fault() => dmar_serve_faults()

2018-01-24 Thread Dmitry Safonov via iommu
Fix the return value, parameters and a bit better naming. Signed-off-by: Dmitry Safonov --- drivers/iommu/dmar.c| 8 +++- drivers/iommu/intel-iommu.c | 2 +- drivers/iommu/intel_irq_remapping.c | 2 +- include/linux/dmar.h| 2 +- 4

Re: [RFC PATCH v2 2/2] iommu/amd: Add support for fast IOTLB flushing

2018-01-24 Thread Suravee Suthikulpanit
Hi Joerg, On 12/27/17 4:20 PM, Suravee Suthikulpanit wrote: Implement the newly added IOTLB flushing interface for AMD IOMMU. Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd_iommu.c | 73 -

[PATCH v5 09/13] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-24 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 Reviewed-by: Tomasz Figa Reviewed-by: Robin Murphy ---

[PATCH v5 12/13] iommu/rockchip: Add runtime PM support

2018-01-24 Thread Jeffy Chen
When the power domain is powered off, the IOMMU cannot be accessed and register programming must be deferred until the power domain becomes enabled. Add runtime PM support, and use runtime PM device link from IOMMU to master to startup and shutdown IOMMU. Signed-off-by: Jeffy Chen

[PATCH v5 13/13] iommu/rockchip: Support sharing IOMMU between masters

2018-01-24 Thread Jeffy Chen
There would be some masters sharing the same IOMMU device. Put them in the same iommu group and share the same iommu domain. Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v5: None Changes in v4: None Changes in v3: Remove

[PATCH v5 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-24 Thread Jeffy Chen
From: Tomasz Figa Current code relies on master driver enabling necessary clocks before IOMMU is accessed, however there are cases when the IOMMU should be accessed while the master is not running yet, for example allocating V4L2 videobuf2 buffers, which is done by the VB2

[PATCH v5 10/13] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-24 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 Reviewed-by: Robin Murphy --- Changes in v5: None

[PATCH v5 11/13] iommu/rockchip: Fix error handling in init

2018-01-24 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of rk_iommu_probe(). Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Reviewed-by: Robin Murphy --- Changes in v5: None Changes in v4: None Changes

[PATCH v5 06/13] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-24 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 v5 05/13] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-24 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 v5 04/13] iommu/rockchip: Fix error handling in attach

2018-01-24 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 v5 03/13] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-01-24 Thread Jeffy Chen
Move request_irq to the end of rk_iommu_probe(). Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: Loop platform_get_irq() as Robin suggested. Changes in v2: None

[PATCH v5 02/13] iommu/rockchip: Fix error handling in probe

2018-01-24 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 6 +- 1 file

[PATCH v5 01/13] iommu/rockchip: Prohibit unbind and remove

2018-01-24 Thread Jeffy Chen
Removal of IOMMUs cannot be done reliably. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v5: None Changes in v4: Rewrite commit message. Changes in v3: Also remove remove() and

[PATCH v5 00/13] iommu/rockchip: Use OF_IOMMU

2018-01-24 Thread Jeffy Chen
This series fixes some issues in rockchip iommu driver, and add of_iommu support in it. Changes in v5: Use out labels to save the duplication between the error and success paths. Use RK_MMU_POLL_PERIOD_US instead of 100. Remove clk names. Use clk_bulk APIs. Avoid race about

Re: [PATCH v3] vfio/type1: Adopt fast IOTLB flush interface when unmap IOVAs

2018-01-24 Thread Suravee Suthikulpanit
Alex / Joerg, On 1/24/18 5:04 AM, Alex Williamson wrote: @@ -648,12 +685,40 @@ static int vfio_iommu_type1_unpin_pages(void *iommu_data, return i > npage ? npage : (i > 0 ? i : -EINVAL); } +static size_t try_unmap_unpin_fast(struct vfio_domain *domain, dma_addr_t iova, +

Re: [PATCH v4 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-24 Thread Tomasz Figa
On Mon, Jan 22, 2018 at 1:09 PM, JeffyChen wrote: > Hi Randy, > > > On 01/22/2018 10:15 AM, JeffyChen wrote: >> >> Hi Randy, >> >> On 01/22/2018 09:18 AM, Randy Li wrote: >>> Also the power domain driver could manage the clocks as well, I would >>> suggest to

Re: [PATCH v6 05/99] xarray: Add definition of struct xarray

2018-01-24 Thread Paul Bolle
Mathhew, Just a minor question. On Wed, 2018-01-17 at 12:20 -0800, Matthew Wilcox wrote: > This is a direct replacement for struct radix_tree_root. Some of the > struct members have changed name; convert those, and use a #define so > that radix_tree users continue to work without change. > >