[PATCH] iommu: change trace unmap api to report unmapped size

2015-01-16 Thread Shuah Khan
Currently map and unmap are implemented as events under a common trace class declaration. The common class forces trace_unmap() to require a bogus physical address argument that it doesn't use. Changing unmap to report unmapped size will provide useful information for debugging. Remove common map_u

[PATCH] iommu: fix trace_unmap() to report original iova

2015-01-16 Thread Shuah Khan
iommu_unmap() calls trace_unmap() with changed iova and original size. trace_unmap() should report original iova instead. Change iommu_unmap() to call trace_unmap() with original iova. Signed-off-by: Shuah Khan Reported-by: Alex Williamson --- drivers/iommu/iommu.c | 3 ++- 1 file changed, 2 in

Re: [PATCH 1/2] iommu: return dma alias from iommu_group_get_for_pci_dev()

2015-01-16 Thread Alex Williamson
Hey Will, On Fri, 2015-01-16 at 20:33 +, Will Deacon wrote: > Hi Alex, > > Thanks for having a look. > > On Fri, Jan 16, 2015 at 05:41:51PM +, Alex Williamson wrote: > > On Fri, 2015-01-16 at 16:58 +, Will Deacon wrote: > > > Some IOMMU drivers (e.g. the ARM SMMU) require not only th

Re: [PATCH 1/2] iommu: return dma alias from iommu_group_get_for_pci_dev()

2015-01-16 Thread Will Deacon
Hi Alex, Thanks for having a look. On Fri, Jan 16, 2015 at 05:41:51PM +, Alex Williamson wrote: > On Fri, 2015-01-16 at 16:58 +, Will Deacon wrote: > > Some IOMMU drivers (e.g. the ARM SMMU) require not only the IOMMU group > > for a PCI device, but also the effective alias of the device

Re: [RFC PATCH 0/5] arm64: IOMMU-backed DMA mapping

2015-01-16 Thread Robin Murphy
On 16/01/15 07:21, Yong Wu wrote: [...] Now that the server seems to be properly accessible again, I've made a branch with both series available here: git://linux-arm.org/linux-rm iommu/dma Note that in the current state it also depends on having the ARM SMMU driver selected in the config,

Re: [PATCH 1/2] iommu: return dma alias from iommu_group_get_for_pci_dev()

2015-01-16 Thread Alex Williamson
On Fri, 2015-01-16 at 16:58 +, Will Deacon wrote: > Some IOMMU drivers (e.g. the ARM SMMU) require not only the IOMMU group > for a PCI device, but also the effective alias of the device (as seen by > the IOMMU) in order to program the translations correctly. > > This patch extends iommu_group

[PATCH 0/2] Reuse generic PCI DMA alias parsing code for the ARM SMMU

2015-01-16 Thread Will Deacon
Hi all, This series of two patches removes the (incomplete) PCI DMA alias parsing code from the ARM SMMU driver and instead modifies the generic iommu_group_get_for_pci_dev implementation to return the alias as well as the group. One snag is that iommu_group_get_for_pci_dev is no longer static af

[PATCH 1/2] iommu: return dma alias from iommu_group_get_for_pci_dev()

2015-01-16 Thread Will Deacon
Some IOMMU drivers (e.g. the ARM SMMU) require not only the IOMMU group for a PCI device, but also the effective alias of the device (as seen by the IOMMU) in order to program the translations correctly. This patch extends iommu_group_get_for_pci_dev to return the DMA alias of the device as well a

[PATCH 2/2] iommu/arm-smmu: remove homebrew PCI dma alias parsing

2015-01-16 Thread Will Deacon
Core code can walk the PCI topology and extract the DMA alias for us whilst retrieving the IOMMU group for a device, so use that instead. Signed-off-by: Will Deacon --- drivers/iommu/arm-smmu.c | 58 ++-- 1 file changed, 31 insertions(+), 27 deletions(

Re: [RFC PATCH 0/5] arm64: IOMMU-backed DMA mapping

2015-01-16 Thread Yong Wu
On Thu, 2015-01-15 at 18:35 +, Robin Murphy wrote: > On 13/01/15 08:02, Yingjoe Chen wrote: > > On Mon, 2015-01-12 at 20:48 +, Robin Murphy wrote: > >> Hi all, > >> > >> Whilst it's a long way off perfect, this has reached the point of being > >> functional and stable enough to be useful, s

[PATCH] iommu: fix trace_map() to report original iova and original size

2015-01-16 Thread Shuah Khan
iommu_map() calls trace_map() with iova and size. trace_map() should report original iova and original size as opposed to iova and size after they get changed during mapping. size is always zero at the end of mapping which is useless to report and iova as it gets incremented, it is not as useful as

Re: [PATCH v11 00/20] VFIO support for platform and ARM AMBA devices

2015-01-16 Thread Baptiste Reynal
Hello Eric, I'm not sure I understand the issue here. I tried to reproduce the bug by triggering an interrupt without unmasking it, but the interrupt is unmasked when the program access to the device (vfio_platform_open reinit IRQs). May I have more details on the bug ? Thanks On Fri, Jan 9, 20

[GIT PULL FOR v3.20] Renesas IPMMU driver

2015-01-16 Thread Laurent Pinchart
Hi Joerg, The following changes since commit eaa27f34e91a14cdceed26ed6c6793ec1d186115: linux 3.19-rc4 (2015-01-11 12:44:53 -0800) are available in the git repository at: git://linuxtv.org/pinchartl/fbdev.git iommu/next for you to fetch changes up to 78e1f974dd351ac82d978e3aac2d27422013f914

Re: [PATCH v3 00/19] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem

2015-01-16 Thread Sjoerd Simons
On Fri, 2015-01-16 at 11:33 +0100, Marek Szyprowski wrote: > Hello, > > On 2014-12-02 10:59, Sjoerd Simons wrote: > > Hey Marek, Inki, > > > > On Wed, 2014-11-19 at 12:15 +0100, Marek Szyprowski wrote: > >> Hello Everyone, > >> > >> This is another attempt to finally make Exynos SYSMMU driver full

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

2015-01-16 Thread Will Deacon
On Fri, Jan 09, 2015 at 01:54:12PM +, Will Deacon wrote: > This is version two of the patch series I originally posted here: > > v1: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/306786.html > > Changes since v1 include: > > - Separated 32-bit and 64-bit regimes >

Re: [PATCH v3 00/19] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem

2015-01-16 Thread Marek Szyprowski
Hello, On 2014-12-02 10:59, Sjoerd Simons wrote: Hey Marek, Inki, On Wed, 2014-11-19 at 12:15 +0100, Marek Szyprowski wrote: Hello Everyone, This is another attempt to finally make Exynos SYSMMU driver fully integrated with DMA-mapping subsystem. The main change from previous version is a reb

[PATCH v4 17/18] iommu: exynos: init from dt-specific callback instead of initcall

2015-01-16 Thread Marek Szyprowski
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 before its master device. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 28 +

[PATCH v4 12/18] iommu: exynos: add support for binding more than one sysmmu to master device

2015-01-16 Thread Marek Szyprowski
This patch adds support for assigning more than one SYSMMU controller to the master device. This has been achieved simply by chaning the struct device pointer in struct exynos_iommu_owner into the list of struct sysmmu_drvdata of all controllers assigned to the given master device. Signed-off-by:

[PATCH v4 14/18] iommu: exynos: rename variables to reflect their purpose

2015-01-16 Thread Marek Szyprowski
This patch renames some variables to make the code easier to understand. 'domain' is replaced by 'iommu_domain' (more generic entity) and really meaning less 'priv' by 'domain' to reflect its purpose. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 191 ++--

[PATCH v4 05/18] ARM: dts: exynos5420: add sysmmu nodes

2015-01-16 Thread Marek Szyprowski
Signed-off-by: Marek Szyprowski --- arch/arm/boot/dts/exynos5420.dtsi | 178 ++ 1 file changed, 178 insertions(+) diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index 03ef2481c640..6d8e73bcfff8 100644 --- a/arch/arm/boot/dt

[PATCH v4 15/18] iommu: exynos: document internal structures

2015-01-16 Thread Marek Szyprowski
Add a few words of comment to all internal structures used by the driver. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 49 +--- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iom

[PATCH v4 06/18] iommu: exynos: don't read version register on every tlb operation

2015-01-16 Thread Marek Szyprowski
This patch removes reading of REG_MMU_VERSION register on every tlb operation and caches SYSMMU version in driver's internal data. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/exyn

[PATCH v4 18/18] iommu: exynos: add callback for initializing devices from device tree

2015-01-16 Thread Marek Szyprowski
This patch adds implementation of of_xlate callback, which prepares masters device for attaching to IOMMU. This callback is called during creating devices from device tree. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 28 1 file changed, 28 inse

[PATCH v4 13/18] iommu: exynos: add support for runtime_pm

2015-01-16 Thread Marek Szyprowski
This patch fixes support for runtime power management for SYSMMU controllers, so they are enabled when master device is attached. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/ex

[PATCH v4 08/18] iommu: exynos: remove useless spinlock

2015-01-16 Thread Marek Szyprowski
This patch removes useless spinlocks and other unused members from struct exynos_iommu_owner. There is no point is protecting this structure by spinlock because content of this structure doesn't change and other structures have their own spinlocks. Signed-off-by: Marek Szyprowski --- drivers/iom

[PATCH v4 07/18] iommu: exynos: remove unused functions

2015-01-16 Thread Marek Szyprowski
This patch removes two unneeded functions, which are not a part of generic IOMMU API and were never used by any other driver. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 31 --- 1 file changed, 31 deletions(-) diff --git a/drivers/iommu/exynos-

[PATCH v4 11/18] iommu: exynos: remove useless device_add/remove callbacks

2015-01-16 Thread Marek Szyprowski
The driver doesn't need to do anything important in device add/remove callbacks, because initialization will be done from device-tree specific callbacks added later. IOMMU groups created by current code were never used. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 28 --

[PATCH v4 16/18] iommu: exynos: remove excessive includes and sort others alphabetically

2015-01-16 Thread Marek Szyprowski
Removed following unused includes: , , and . Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index ef7172551a39..c53cc8f61176 100644 --

[PATCH v4 09/18] iommu: exynos: refactor function parameters to simplify code

2015-01-16 Thread Marek Szyprowski
This patch simplifies the code by: - refactoring function parameters from struct device pointer to direct pointer to struct sysmmu drvdata - moving list_head enteries from struct exynos_iommu_owner directly to struct sysmmu_drvdata Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iom

[PATCH v4 10/18] iommu: exynos: remove unused functions, part 2

2015-01-16 Thread Marek Szyprowski
After refactoring functions to use pointer to struct sysmmu_drvdata directly, some functions became useless and thus never used, so remove them completely. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 43 --- 1 file changed, 43 deleti

[PATCH v4 02/18] arm: exynos: pm_domains: add support for devices registered before arch_initcall

2015-01-16 Thread Marek Szyprowski
SYSMMU devices will be registered early before any other devices and before calling arch_initcall. To add them to respective power domains, additional scan of all platform devices is needed. Signed-off-by: Marek Szyprowski --- arch/arm/mach-exynos/pm_domains.c | 9 - 1 file changed, 8 in

[PATCH v4 04/18] ARM: dts: exynos5250: add sysmmu nodes

2015-01-16 Thread Marek Szyprowski
Signed-off-by: Marek Szyprowski --- arch/arm/boot/dts/exynos5250.dtsi | 250 ++ 1 file changed, 250 insertions(+) diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index cf4a6ec62f71..30d29ff502a7 100644 --- a/arch/arm/boot/dt

[PATCH v4 01/18] drm: exynos: detach from default dma-mapping domain on init

2015-01-16 Thread Marek Szyprowski
This patch adds code, which detach sub-device nodes from default iommu domain if such has been configured. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu

[PATCH v4 00/18] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem

2015-01-16 Thread Marek Szyprowski
Hello Everyone, This is yet another attempt to get Exynos SYSMMU driver with integrated with IOMMU & DMA-mapping subsystems. The main change from previous version is a rebase onto latest v3.19-rc4 kernel base, which includes "automatic DMA configuration for IOMMU masters" patches developed by Will

[PATCH v4 03/18] ARM: dts: exynos4: add sysmmu nodes

2015-01-16 Thread Marek Szyprowski
This patch adds System MMU nodes that are specific to Exynos4210/4x12 series. Signed-off-by: Marek Szyprowski --- arch/arm/boot/dts/exynos4.dtsi| 118 ++ arch/arm/boot/dts/exynos4210.dtsi | 23 arch/arm/boot/dts/exynos4x12.dtsi | 82