Re: [RFC PATCH v3 3/7] iommu: add new iommu_ops callback for adding an OF device

2014-09-16 Thread Will Deacon
On Mon, Sep 15, 2014 at 12:57:38PM +0100, Marek Szyprowski wrote: > Hello, Hi Marek, Thanks for looking again at this -- I'll take at look at your exynos series when I'm back in the UK next week. > On 2014-09-12 18:34, Will Deacon wrote: > > This patch adds a new function to the iommu_ops struct

Re: [PATCH v1 16/21] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq

2014-09-16 Thread Yijing Wang
On 2014/9/16 19:35, Sebastian Ott wrote: > Hello, > > On Fri, 5 Sep 2014, Yijing Wang wrote: >> Use MSI chip framework instead of arch MSI functions to configure >> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. >> >> Signed-off-by: Yijing Wang >> --- >> arch/s390/pci/pci.

Re: [RFC PATCH v3 0/7] Introduce automatic DMA configuration for IOMMU masters

2014-09-16 Thread Will Deacon
On Tue, Sep 16, 2014 at 12:40:27PM +0100, Robin Murphy wrote: > On 12/09/14 17:34, Will Deacon wrote: > > Here is version three of the RFC I've previously posted here: > > > >RFCv1: > > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/283023.html > >RFCv2: > > http://list

RE: [RFC][PATCH] devicetree: Add master-id-bits property to the iommu device

2014-09-16 Thread Varun Sethi
Hi Arnd, > -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Arnd Bergmann > Sent: Monday, September 15, 2014 10:27 PM > To: Sethi Varun-B16395 > Cc: mark.rutl...@arm.com; devicet...@vger.kernel.org; > swar

Re: [RFC][PATCH] devicetree: Add master-id-bits property to the iommu device

2014-09-16 Thread Arnd Bergmann
On Monday 15 September 2014, Varun Sethi wrote: > > > > This seems rather specific to MMU-500. I don't think that most IOMMUs would > > use the term 'master ID', 'stream ID' or even the general concept, and you > > don't expand the acronym 'TBU'. I've seen many IOMMUs and I don't even > > know wha

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

2014-09-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 v2 15/18] iommu: exynos: document internal structures

2014-09-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 v2 18/18] iommu: exynos: add callback for initializing devices from device tree

2014-09-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 v2 17/18] iommu: exynos: init from dt-specific callback instead of initcall

2014-09-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 | 32

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

2014-09-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 a75b06365f97..5eb999d7653a 100644 --

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

2014-09-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 v2 09/18] iommu: exynos: refactor function parameters to simplify code

2014-09-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 v2 12/18] iommu: exynos: add support for binding more than one sysmmu to master device

2014-09-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 v2 13/18] iommu: exynos: add support for runtime_pm

2014-09-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 v2 10/18] iommu: exynos: remove unused functions, part 2

2014-09-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 v2 08/18] iommu: exynos: remove useless spinlock

2014-09-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 v2 05/18] ARM: DTS: Exynos4: add System MMU nodes

2014-09-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| 117 ++ arch/arm/boot/dts/exynos4210.dtsi | 23 arch/arm/boot/dts/exynos4x12.dtsi | 82

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

2014-09-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 v2 01/18] arm: dma-mapping: arm_iommu_attach_device: automatically set max_seg_size

2014-09-16 Thread Marek Szyprowski
If device has no max_seg_size set, we assume that there is no limit and force it to DMA_BIT_MASK(32) to always use contiguous mappings in DMA address space. Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/ar

[PATCH v2 02/18] arm: exynos: bind power domains earlier, on device creation

2014-09-16 Thread Marek Szyprowski
This patches change initialization time of power domain driver from client device driver bind to device creation. This lets other core drivers to register power domain notifiers before client driver is bound. Signed-off-by: Marek Szyprowski --- arch/arm/mach-exynos/pm_domains.c | 12 ++--

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

2014-09-16 Thread Marek Szyprowski
Hello Everyone, This is yet another attempt to finally make Exynos SYSMMU driver fully integrated with DMA-mapping subsystem. Previous approach is available here: https://lkml.org/lkml/2014/8/5/183 I meantime, there have been a discussion about the way the iommu driver should be integrated with

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

2014-09-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 v2 03/18] drm: exynos: detach from default dma-mapping domain on init

2014-09-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 v2 04/18] clk: exynos: add missing smmu_g2d clock and update comments

2014-09-16 Thread Marek Szyprowski
This patch adds missing smmu_g2d clock implementation and updates comment about Exynos4 clocks from 278-282 range. Those clocks are available on all Exynos4 SoC series, so the misleading comment has been removed. Signed-off-by: Marek Szyprowski Acked-by: Tomasz Figa --- drivers/clk/samsung/clk-

Re: [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()

2014-09-16 Thread Yijing Wang
>>> arch_teardown_msi_irq() expects to find the msi_chip in the irq >>> chip_data field. As this means drivers don't have any reasonable other >>> possibility to stuff things into this field, I think it would make sense >>> to do the cleanup the other way around: keep the irq_set_chip_data >>> arch

Re: [PATCH v1 03/21] MSI: Remove the redundant irq_set_chip_data()

2014-09-16 Thread Lucas Stach
Am Dienstag, den 16.09.2014, 09:30 +0800 schrieb Yijing Wang: > On 2014/9/15 22:00, Lucas Stach wrote: > > Am Freitag, den 05.09.2014, 18:09 +0800 schrieb Yijing Wang: > >> Currently, pcie-designware, pcie-rcar, pci-tegra drivers > >> use irq chip_data to save the msi_chip pointer. They > >> alread

Re: [Patch Part3 V5 5/8] iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit hotplug

2014-09-16 Thread Jiang Liu
On 2014/9/16 15:53, Yijing Wang wrote: > On 2014/9/16 15:00, Jiang Liu wrote: >> On 2014/9/15 10:20, Yijing Wang wrote: +static void ir_remove_ioapic_hpet_scope(struct intel_iommu *iommu) +{ + int i; - ir_parse_one_hpet_scope(scope, iommu); -

Re: [Patch Part3 V5 1/8] iommu/vt-d: Introduce helper function dmar_walk_resources()

2014-09-16 Thread Yijing Wang
>>> #include "irq_remapping.h" >>> >>> +typedef int (*dmar_res_handler_t)(struct acpi_dmar_header *, void *); >>> +struct dmar_res_callback { >>> + dmar_res_handler_t cb[ACPI_DMAR_TYPE_RESERVED]; >>> + void*arg[ACPI_DMAR_TYPE_RESERVED]; >>> + bool

Re: [Patch Part3 V5 5/8] iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit hotplug

2014-09-16 Thread Yijing Wang
On 2014/9/16 15:00, Jiang Liu wrote: > On 2014/9/15 10:20, Yijing Wang wrote: >>> +static void ir_remove_ioapic_hpet_scope(struct intel_iommu *iommu) >>> +{ >>> + int i; >>> >>> - ir_parse_one_hpet_scope(scope, iommu); >>> - } >>> - start += scope->length;

Re: [Patch Part3 V5 0/8] Enable support of Intel DMAR device hotplug

2014-09-16 Thread Jiang Liu
On 2014/9/15 15:54, Yijing Wang wrote: > I built and boot this series in Huawei RH5885 (Intel(R) Xeon(R) CPU E7- 4807, > two IOHs and two IOMMUs), > It works fine, IRQ remap and DMA remap are both look good. > But because my platform BIOS has no _DSM, so I didn't test the hotplug case > yet. >

Re: [Patch Part3 V5 1/8] iommu/vt-d: Introduce helper function dmar_walk_resources()

2014-09-16 Thread Jiang Liu
On 2014/9/12 17:16, Yijing Wang wrote: > On 2014/9/12 10:10, Jiang Liu wrote: >> Introduce helper function dmar_walk_resources to walk resource entries >> in DMAR table and ACPI buffer object returned by ACPI _DSM method >> for IOMMU hot-plug. >> >> Signed-off-by: Jiang Liu > > Hi Gerry. some com

Re: [Patch Part3 V5 5/8] iommu/vt-d: Enhance intel_irq_remapping driver to support DMAR unit hotplug

2014-09-16 Thread Jiang Liu
On 2014/9/15 10:20, Yijing Wang wrote: >> +static void ir_remove_ioapic_hpet_scope(struct intel_iommu *iommu) >> +{ >> +int i; >> >> -ir_parse_one_hpet_scope(scope, iommu); >> -} >> -start += scope->length; >> -} >> +for (i = 0; i < MAX_HPET