RE: [PATCH 2/7] iommu: add api to get iommu_domain of a device

2013-10-06 Thread Bhushan Bharat-R65777
> -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Friday, October 04, 2013 11:42 PM > To: Bhushan Bharat-R65777 > Cc: j...@8bytes.org; b...@kernel.crashing.org; ga...@kernel.crashing.org; > linux- > ker...@vger.kernel.org; linuxppc-...@lists.ozlabs.

[PATCH v10 20/20] iommu/exynos: add devices attached to the System MMU to an IOMMU group

2013-10-06 Thread Cho KyongHo
Patch written by Antonios Motakis : IOMMU groups are expected by certain users of the IOMMU API, e.g. VFIO. Since each device is behind its own System MMU, we can allocate a new IOMMU group for each device. Reviewd-by: Cho KyongHo Signed-off-by: Antonios Motakis --- drivers/iommu/exynos-iommu.

[PATCH v10 19/20] iommu/exynos: return 0 if iommu_attach_device() successes

2013-10-06 Thread Cho KyongHo
iommu_attach_device() against exynos-iommu positive integer on success if the caller calls iommu_attach_device() with the same iommu_domain multiple times without call to iommu_detach_device() to inform the caller how many calls to iommu_detach_device() to really detach iommu. However the conventi

[PATCH v10 18/20] iommu/exynos: change rwlock to spinlock

2013-10-06 Thread Cho KyongHo
Since acquiring read_lock is not more frequent than write_lock, it is not beneficial to use rwlock, this commit changes rwlock to spinlock. Reviewed-by: Grant Grundler Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 35 ++- 1 files changed, 18 ins

[PATCH v10 17/20] iommu/exynos: add support for power management subsystems.

2013-10-06 Thread Cho KyongHo
This adds support for Suspend to RAM and Runtime Power Management. Since System MMU is located in the same local power domain of its master H/W, System MMU must be initialized before it is working if its power domain was ever turned off. TLB invalidation according to unmapping on page tables must

[PATCH v10 14/20] iommu/exynos: remove custom fault handler

2013-10-06 Thread Cho KyongHo
This commit removes custom fault handler. The device drivers that need to register fault handler can register with iommu_set_fault_handler(). CC: Grant Grundler Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 80 - 1 files changed, 24 inse

[PATCH v10 15/20] iommu/exynos: remove calls to Runtime PM API functions

2013-10-06 Thread Cho KyongHo
Runtime power management by exynos-iommu driver independently from master H/W's runtime pm is not useful for power saving since attaching master H/W in probing time turns on its local power endlessly. Thus this removes runtime pm API calls. Runtime PM support is added in the following commits to ex

[PATCH v10 13/20] iommu/exynos: gating clocks of master H/W

2013-10-06 Thread Cho KyongHo
This patch gates clocks of master H/W as well as clocks of System MMU if master clocks are specified. Some Exynos SoCs (i.e. GScalers in Exynos5250) have dependencies in the gating clocks of master H/W and its System MMU. If a H/W is the case, accessing control registers of System MMU is prohibite

[PATCH v10 11/20] ARM: dts: Add description of System MMU of Exynos SoCs

2013-10-06 Thread Cho KyongHo
This patch adds dts entries for the System MMU devices found on Exynos4 and Exynos5 SoC series and the System MMU binding documentation. CC: Sylwester Nawrocki Signed-off-by: Cho KyongHo --- .../bindings/iommu/samsung,exynos4210-sysmmu.txt | 76 + arch/arm/boot/dts/exynos4.dtsi

[PATCH v10 16/20] iommu/exynos: turn on useful configuration options

2013-10-06 Thread Cho KyongHo
This turns on ACGEN and SYSSEL. ACGEN is architectural clock gating that gates clocks by System MMU itself if it is not active. Note that ACGEN is different from clock gating by the CPU. ACGEN just gates clocks to the internal logic of System MMU while clock gating by the CPU gates clocks to the S

[PATCH v10 12/20] iommu/exynos: support for device tree

2013-10-06 Thread Cho KyongHo
This commit adds device tree support for System MMU. This also include the following changes and enhancements: * use managed device helper functions. Simplyfies System MMU device driver. Signed-off-by: Cho KyongHo --- drivers/iommu/Kconfig|5 ++--- drivers/iommu/exynos-iommu.c | 2

[PATCH v10 10/20] clk: exynos: add gate clock descriptions of System MMU

2013-10-06 Thread Cho KyongHo
This adds gate clocks of all System MMUs and their master IPs that are not apeared in clk-exynos5250.c and clk-exynos5420.c Also fixes GATE_IP_ACP to 0x18800 and changed GATE_DA to GATE for System MMU clocks in clk-exynos4.c Signed-off-by: Cho KyongHo --- .../devicetree/bindings/clock/exynos5250

[PATCH v10 09/20] iommu/exynos: use managed device helper functions

2013-10-06 Thread Cho KyongHo
This patch uses managed device helper functions in the probe(). Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 64 - 1 files changed, 25 insertions(+), 39 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu

[PATCH v10 08/20] iommu/exynos: remove dbgname from drvdata of a System MMU

2013-10-06 Thread Cho KyongHo
This patch removes dbgname member from sysmmu_drvdata structure. Kernel message for debugging already has the name of a single System MMU node. Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 34 +- 1 files changed, 13 insertions(+), 21 deletions(-

[PATCH v10 06/20] iommu/exynos: always enable runtime PM

2013-10-06 Thread Cho KyongHo
Checking if the probing device has a parent device was just to discover if the probing device is involved in a power domain when the power domain controlled by Samsung's custom implementation. Since generic IO power domain is applied, it is required to remove the condition to see if the probing dev

[PATCH v10 07/20] iommu/exynos: always use a single clock descriptor

2013-10-06 Thread Cho KyongHo
System MMU driver is changed to control only a single instance of System MMU at a time. Since a single instance of System MMU has only a single clock descriptor for its clock gating, there is no need to obtain two or more clock descriptors. Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iom

[PATCH v10 05/20] iommu/exynos: allocate lv2 page table from own slab

2013-10-06 Thread Cho KyongHo
Since kmalloc() does not guarantee that the allignment of 1KiB when it allocates 1KiB, it is required to allocate lv2 page table from own slab that guarantees alignment of 1KiB Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 34 -- 1 files changed,

[PATCH v10 04/20] iommu/exynos: fix L2TLB invalidation

2013-10-06 Thread Cho KyongHo
L2TLB is 8-way set-associative TLB with 512 entries. The number of sets is 64. A single 4KB(small page) translation information is cached only to a set whose index is the same with the lower 6 bits of the page frame number. A single 64KB(large page) translation information can be cached to any 16 s

[PATCH v10 03/20] iommu/exynos: change error handling when page table update is failed

2013-10-06 Thread Cho KyongHo
This patch changes not to panic on any error when updating page table. Instead prints error messages with callstack. Signed-off-by: Cho KyongHo --- drivers/iommu/exynos-iommu.c | 58 +++-- 1 files changed, 44 insertions(+), 14 deletions(-) diff --git a/driv

[PATCH v10 01/20] iommu/exynos: do not include removed header

2013-10-06 Thread Cho KyongHo
Commit 25e9d28d92 (ARM: EXYNOS: remove system mmu initialization from exynos tree) removed arch/arm/mach-exynos/mach/sysmmu.h header without removing remaining use of it from exynos-iommu driver, thus causing a compilation error. This patch fixes the error by removing respective include line from

[PATCH v10 00/20] iommu/exynos: Fixes and Enhancements of System MMU driver with DT

2013-10-06 Thread Cho KyongHo
The current exynos-iommu(System MMU) driver does not work autonomously since it is lack of support for power management of peripheral blocks. For example, MFC device driver must ensure that its System MMU is disabled before MFC block is power-down not to invalidate IOTLB in the System MMU when I/O

[PATCH v10 02/20] iommu/exynos: add missing cache flush for removed page table entries

2013-10-06 Thread Cho KyongHo
This commit adds cache flush for removed small and large page entries in exynos_iommu_unmap(). Missing cache flush of removed page table entries can cause missing page fault interrupt when a master IP accesses an unmapped area. Reviewed-by: Tomasz Figa Tested-by: Grant Grundler Signed-off-by: Ch