[PATCH v4 5/8] iommu/rockchip: Prepare to support generic DMA mapping

2016-06-20 Thread Tomasz Figa
From: Shunqian Zheng Set geometry for allocated domains and fix .domain_alloc() callback to work with IOMMU_DOMAIN_DMA domain type, which is used for implicit domains on ARM64. Signed-off-by: Shunqian Zheng Signed-off-by: Tomasz Figa --- drivers/iommu/rockchip-iommu.c | 16 +++- 1

[PATCH v4 8/8] iommu/rockchip: Enable Rockchip IOMMU on ARM64

2016-06-20 Thread Tomasz Figa
From: Simon Xue This patch makes it possible to compile the rockchip-iommu driver on ARM64, so that it can be used with 64-bit SoCs equipped with this type of IOMMU. Signed-off-by: Simon Xue Signed-off-by: Shunqian Zheng Signed-off-by: Tomasz Figa --- drivers/iommu/Kconfig | 2 +- 1 file cha

[PATCH v4 7/8] drm/rockchip: Use common IOMMU API to attach devices

2016-06-20 Thread Tomasz Figa
From: Shunqian Zheng Rockchip DRM used the arm special API, arm_iommu_*(), to attach iommu for ARM32 SoCs. This patch convert to common iommu API so it would support ARM64 like RK3399. Since previous patch added support for direct IOMMU address space management, there is no need to use DMA API a

[PATCH v4 4/8] iommu/rockchip: Use DMA API to manage coherency

2016-06-20 Thread Tomasz Figa
From: Shunqian Zheng Use DMA API instead of architecture internal functions like __cpuc_flush_dcache_area() etc. The biggest difficulty here is that dma_map and _sync calls require some struct device, while there is no real 1:1 relation between an IOMMU domain and some device. To overcome this,

[PATCH v4 6/8] drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain

2016-06-20 Thread Tomasz Figa
The API is not suitable for subsystems consisting of multiple devices and requires severe hacks to use it. To mitigate this, this patch implements allocation and address space management locally by using helpers provided by DRM framework, like other DRM drivers do, e.g. Tegra. This patch should no

[PATCH v4 1/8] iommu/rockchip: Fix devm_{request,free}_irq parameter

2016-06-20 Thread Tomasz Figa
From: Simon Xue Even though the IOMMU shares IRQ with its master, the struct device passed to {request,free}_irq is supposed to represent the device that is signalling the interrupt. This patch makes the driver use IOMMU device instead of master's device to make things clear. Signed-off-by: Simo

[PATCH v4 3/8] iommu/rockchip: Fix allocation of bases array in driver probe

2016-06-20 Thread Tomasz Figa
From: Shunqian Zheng In .probe(), devm_kzalloc() is called with size == 0 and works only by luck, due to internal behavior of the allocator and the fact that the proper allocation size is small. Let's use proper value for calculating the size. Fixes: cd6438c5f844 ("iommu/rockchip: Reconstruct to

[PATCH v4 2/8] iommu/rockchip: Add map_sg callback for rk_iommu_ops

2016-06-20 Thread Tomasz Figa
From: Simon Xue The iommu_dma_alloc() in iommu/dma-iommu.c calls iommu_map_sg() that requires the callback iommu_ops .map_sg(). Adding the default_iommu_map_sg() to Rockchip IOMMU accordingly. Signed-off-by: Simon Xue Signed-off-by: Shunqian Zheng Reviewed-on: https://chromium-review.googlesou

[PATCH v4 0/8] iommu/rockchip: Fix bugs and enable on ARM64

2016-06-20 Thread Tomasz Figa
This series intends mostly to enable support for ARM64 architecture in the rockchip-iommu driver. On the way to do so, some bugs are also fixed. The most important changes here are: - making the Rockchip IOMMU driver use DMA API for managing cache coherency of page tables, - making the Rockch

Re: SMMU driver and stall vs terminate mode

2016-06-20 Thread Robin Murphy
Hi Stuart, On 20/06/16 16:28, Stuart Yoder wrote: Robin/Will, Right now the SMMU driver is hardcoded to configure 'stall' mode for context faults: /* SCTLR */ reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP; We are running into an issue with a device where

Re: [PATCH v9 0/7] KVM PCIe/MSI passthrough on ARM/ARM64: kernel part 3/3: vfio changes

2016-06-20 Thread Pranav Sawargaonkar
On Mon, Jun 20, 2016 at 9:12 PM, Pranav Sawargaonkar wrote: > Hi Eric, > > Tested this series on APM X-Gene2 with E1000 and sata sil card. > Tested-By: Pranavkumar Sawargaonkar > > Thanks, > Pranav > > > On Thu, Jun 9, 2016 at 1:25 PM, Auger Eric wrote: >> Alex, >>> On Wed, 8 Jun 2016 10:29:35 +

Re: [PATCH v9 0/7] KVM PCIe/MSI passthrough on ARM/ARM64: kernel part 3/3: vfio changes

2016-06-20 Thread Pranav Sawargaonkar
Hi Eric, Tested this series on APM X-Gene2 with E1000 and sata sil card. Tested-By: Pranavkumar Sawargaonkar Thanks, Pranav On Thu, Jun 9, 2016 at 1:25 PM, Auger Eric wrote: > Alex, >> On Wed, 8 Jun 2016 10:29:35 +0200 >> Auger Eric wrote: >> >>> Dear all, >>> Le 20/05/2016 à 18:01, Eric Aug

SMMU driver and stall vs terminate mode

2016-06-20 Thread Stuart Yoder
Robin/Will, Right now the SMMU driver is hardcoded to configure 'stall' mode for context faults: /* SCTLR */ reg = SCTLR_CFCFG | SCTLR_CFIE | SCTLR_CFRE | SCTLR_M | SCTLR_EAE_SBOP; We are running into an issue with a device where it seems behave sanely when SCTLR_CFCFG=0 ...i.e. 'ter

Re: [PATCH] iommu/amd: Remove create_workqueue

2016-06-20 Thread Tejun Heo
On Sat, Jun 18, 2016 at 01:58:30PM +0530, Bhaktipriya Shridhar wrote: > alloc_workqueue replaces deprecated create_workqueue(). > > A dedicated workqueue has been used since the workitem (viz > &fault->work), is involved in IO page-fault handling. > WQ_MEM_RECLAIM has been set to guarantee forward