[PATCH 3/3] arm: dts: mediatek: add larbid property for larb

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Add mediatek's hardware id information for smi larb. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi index f1efdc6..2cddbec 100644 --- a/arch/

[PATCH 1/3] memory: mtk-smi: add larbid init routine

2017-07-26 Thread honghui.zhang
From: Honghui Zhang In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larb->larbid was added but not initialized. Mediatek's gen1 smi need this hardware larbid information to get the register offset which controls whether enable iommu for this larb. This patch add the in

[PATCH 0/3] Add larbid init routine for mediatek's gen1 smi larb driver

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Mediatek's gen1 smi need the hardware larbid to identify the offset for the register which controls whether enable iommu for this larb. In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larbid was used without properly initialized. This patchset fixed

[PATCH 2/3] dt-bindings: mediatek: add descriptions for larbid

2017-07-26 Thread honghui.zhang
From: Honghui Zhang This patch add larbid descritptions for mediatek's gen1 smi larb hardware. Signed-off-by: Honghui Zhang --- .../bindings/memory-controllers/mediatek,smi-larb.txt | 15 +++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/memo

Re: [PATCH 3/4] iommu/tegra-gart: Add iommu_group support

2017-07-26 Thread Dmitry Osipenko
On 21.07.2017 15:12, Robin Murphy wrote: > As the last step to making groups mandatory, clean up the remaining > drivers by adding basic support. Whilst it may not perfectly reflect the > isolation capabilities of the hardware, using generic_device_group() > should at least maintain existing behavi

Re: [PATCH 1/4] iommu/msm: Add iommu_group support

2017-07-26 Thread Sricharan R
Hi Robin, On 7/24/2017 3:25 PM, Robin Murphy wrote: > On 24/07/17 08:34, Sricharan R wrote: >> Hi Robin, >> >>> As the last step to making groups mandatory, clean up the remaining >>> drivers by adding basic support. Whilst it may not perfectly reflect the >>> isolation capabilities of the hardwar

Re: [RFC 0/2] arm-smmu-v3 tlbi-on-map option

2017-07-26 Thread Auger Eric
Hi Will, Michael, On 12/07/2017 19:54, Will Deacon wrote: > Hi Eric, > > On Sun, Jul 09, 2017 at 05:15:01PM +0200, Eric Auger wrote: >> This series adds a new tlbi-on-map option to the smmuv3 driver. >> When set, the IO_PGTABLE_QUIRK_TLBI_ON_MAP quirk is applied for >> LPAE tables and the smmuv3

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Heiko Stübner
Hi Joerg, Am Mittwoch, 26. Juli 2017, 14:27:53 CEST schrieb Joerg Roedel: > On Wed, Jul 26, 2017 at 01:44:02PM +0200, Heiko Stübner wrote: > > I really would prefer iommu dt-nodes going through my tree :-) > > > > Especially as parts of these conflict with already pending patches for > > graphics

Re: [PATCH v3 03/12] intel-ipu3: Add DMA API implementation

2017-07-26 Thread Tomasz Figa
On Fri, Jul 21, 2017 at 7:09 AM, Sakari Ailus wrote: > Hi Arnd, > > On Wed, Jul 19, 2017 at 09:24:41AM +0200, Arnd Bergmann wrote: >> On Wed, Jul 19, 2017 at 5:12 AM, Yong Zhi wrote: >> > From: Tomasz Figa >> > >> > This patch adds support for the IPU3 DMA mapping API. >> > >> > Signed-off-by: T

Re: [PATCH] iommu/amd: Fix schedule-while-atomic BUG in initialization code

2017-07-26 Thread Joerg Roedel
On Wed, Jul 26, 2017 at 03:25:05PM +0200, Artem Savkov wrote: > On Wed, Jul 26, 2017 at 02:26:14PM +0200, Joerg Roedel wrote: > > Yes, that should fix it, but I think its better to just move the > > register_syscore_ops() call to a later initialization step, like in the > > patch below. I tested it

Re: [PATCH] iommu/amd: Fix schedule-while-atomic BUG in initialization code

2017-07-26 Thread Artem Savkov
On Wed, Jul 26, 2017 at 02:26:14PM +0200, Joerg Roedel wrote: > Hi Artem, Thomas, > > On Wed, Jul 26, 2017 at 12:42:49PM +0200, Thomas Gleixner wrote: > > On Tue, 25 Jul 2017, Artem Savkov wrote: > > > > > Hi, > > > > > > Commit 1c3c5ea "sched/core: Enable might_sleep() and smp_processor_id() >

Re: [PATCH] iommu/amd: Fix schedule-while-atomic BUG in initialization code

2017-07-26 Thread Thomas Gleixner
On Wed, 26 Jul 2017, Joerg Roedel wrote: > Yes, that should fix it, but I think its better to just move the > register_syscore_ops() call to a later initialization step, like in the > patch below. I tested it an will queue it to my iommu/fixes branch. Fair enough. Acked-by-me. ___

[PATCH v2] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 4afbc41..

Re: [PATCH] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread Honghui Zhang
On Wed, 2017-07-26 at 11:36 +0100, Robin Murphy wrote: > On 26/07/17 10:59, honghui.zh...@mediatek.com wrote: > > From: Honghui Zhang > > > > * for mtk smi gen 1, we need to get the ao(always on) base to config > > * m4u port, and we need to enable the aync clock for transform the smi

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Joerg Roedel
Hey Heiko, On Wed, Jul 26, 2017 at 01:44:02PM +0200, Heiko Stübner wrote: > I really would prefer iommu dt-nodes going through my tree :-) > > Especially as parts of these conflict with already pending patches for > graphics support and with the iommu nodes sitting in your tree these > would need

[PATCH] iommu/amd: Fix schedule-while-atomic BUG in initialization code

2017-07-26 Thread Joerg Roedel
Hi Artem, Thomas, On Wed, Jul 26, 2017 at 12:42:49PM +0200, Thomas Gleixner wrote: > On Tue, 25 Jul 2017, Artem Savkov wrote: > > > Hi, > > > > Commit 1c3c5ea "sched/core: Enable might_sleep() and smp_processor_id() > > checks early" seem to have uncovered an issue with amd-iommu/x2apic. > > >

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Heiko Stübner
Hi Joerg, Am Mittwoch, 26. Juli 2017, 12:58:19 CEST schrieb Joerg Roedel: > On Mon, Jul 24, 2017 at 10:32:07AM +0800, Simon Xue wrote: > > Add H265e/VEPU/VPU/VDEC/VOP iommu nodes > > > > Signed-off-by: Simon Xue > > --- > > > > changes since V2: > > - none > > > > arch/arm64/boot/dts/rockch

Re: [PATCH kernel v4 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization

2017-07-26 Thread Benjamin Herrenschmidt
On Wed, 2017-07-26 at 11:50 +0200, Joerg Roedel wrote: > > 3. Create IOMMU_DOMAIN_UNMANAGED IOMMU domains for PPC64/powernv IOMMU > > groups and only define capable() hook to report IOMMU_CAP_INTR_REMAP; > > others already use these IOMMU domains. VFIO-PCI's mmap() hook could then > > check the cap

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-07-26 Thread Leizhen (ThunderTown)
On 2017/7/26 19:08, Joerg Roedel wrote: > Hi Robin. > > On Fri, Jul 21, 2017 at 12:41:57PM +0100, Robin Murphy wrote: >> Hi all, >> >> In the wake of the ARM SMMU optimisation efforts, it seems that certain >> workloads (e.g. storage I/O with large scatterlists) probably remain quite >> heavily

Re: [PATCH 0/4] IOMMU group cleanup

2017-07-26 Thread Joerg Roedel
Hi Robin, On Fri, Jul 21, 2017 at 01:12:34PM +0100, Robin Murphy wrote: > Robin Murphy (4): > iommu/msm: Add iommu_group support > iommu/tegra-smmu: Add iommu_group support > iommu/tegra-gart: Add iommu_group support > iommu: Finish making iommu_group support mandatory > > drivers/iommu/

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-07-26 Thread Joerg Roedel
Hi Robin. On Fri, Jul 21, 2017 at 12:41:57PM +0100, Robin Murphy wrote: > Hi all, > > In the wake of the ARM SMMU optimisation efforts, it seems that certain > workloads (e.g. storage I/O with large scatterlists) probably remain quite > heavily influenced by IOVA allocation performance. Separatel

Re: [PATCH] iommu: Convert to using %pOF instead of full_name

2017-07-26 Thread Joerg Roedel
On Tue, Jul 18, 2017 at 04:43:09PM -0500, Rob Herring wrote: > Now that we have a custom printf format specifier, convert users of > full_name to use %pOF instead. This is preparation to remove storing > of the full path string for each node. > > Signed-off-by: Rob Herring > Cc: Joerg Roedel > C

Re: [PATCH V3 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Joerg Roedel
On Mon, Jul 24, 2017 at 10:32:07AM +0800, Simon Xue wrote: > Add H265e/VEPU/VPU/VDEC/VOP iommu nodes > > Signed-off-by: Simon Xue > --- > changes since V2: > - none > > arch/arm64/boot/dts/rockchip/rk3328.dtsi | 45 > > 1 file changed, 45 insertions(+) Applie

Re: [PATCH V3 1/3] Docs: dt: rockchip: add rockchip,disable-mmu-reset property

2017-07-26 Thread Joerg Roedel
On Mon, Jul 24, 2017 at 10:37:13AM +0800, Simon Xue wrote: > Add rockchip,disable-mmu-reset property to disable some mmu > reset operation > > Signed-off-by: Simon Xue > --- > changes since V2: > use rockchip,disable-mmu-reset instead of rk-iommu,disable-reset-quirk Applied all, thanks. ___

Re: [PATCH 1/4] ARM64: dts: rockchip: rk3328 add iommu nodes

2017-07-26 Thread Joerg Roedel
On Tue, Jul 18, 2017 at 06:02:02PM +0800, Simon Xue wrote: > From: Simon > > Add H265e/VEPU/VPU/VDEC/VOP iommu nodes > > Signed-off-by: Simon > --- > arch/arm64/boot/dts/rockchip/rk3328.dtsi | 45 > > 1 file changed, 45 insertions(+) Applied all, thanks.

Re: [PATCH v2 01/05] iommu/ipmmu-vmsa: Use iommu_device_register()/unregister()

2017-07-26 Thread Joerg Roedel
On Mon, Jul 17, 2017 at 10:05:10PM +0900, Magnus Damm wrote: > --- 0001/drivers/iommu/ipmmu-vmsa.c > +++ work/drivers/iommu/ipmmu-vmsa.c 2017-07-17 21:01:47.140607110 +0900 > @@ -35,6 +35,7 @@ > struct ipmmu_vmsa_device { > struct device *dev; > void __iomem *base; > + struct iom

Re: amd-iommu/x2apic: sleeping function called from invalid context

2017-07-26 Thread Thomas Gleixner
On Tue, 25 Jul 2017, Artem Savkov wrote: > Hi, > > Commit 1c3c5ea "sched/core: Enable might_sleep() and smp_processor_id() > checks early" seem to have uncovered an issue with amd-iommu/x2apic. > > Starting with that commit the following warning started to show up on AMD > systems during boot:

Re: [PATCH v3 02/12] intel-ipu3: mmu: implement driver

2017-07-26 Thread Tomasz Figa
Hi Robin, On Wed, Jul 19, 2017 at 10:37 PM, Robin Murphy wrote: > On 19/07/17 04:12, Yong Zhi wrote: >> From: Tomasz Figa >> >> This driver translates Intel IPU3 internal virtual >> address to physical address. >> >> Signed-off-by: Tomasz Figa >> Signed-off-by: Yong Zhi >> --- >> drivers/medi

Re: [PATCH] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread Robin Murphy
On 26/07/17 10:59, honghui.zh...@mediatek.com wrote: > From: Honghui Zhang > > Replace custom code with generic helper to retrieve driver data. > > Signed-off-by: Honghui Zhang > --- > drivers/memory/mtk-smi.c | 18 -- > 1 file changed, 4 insertions(+), 14 deletions(-) > > dif

[PATCH] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 4afbc

[PATCH] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 4afbc41..

Re: [PATCH] iommu/exynos: Replace non-existing big-endian Kconfig option

2017-07-26 Thread Joerg Roedel
On Mon, Jul 17, 2017 at 07:47:02AM +0200, Krzysztof Kozlowski wrote: > Wrong Kconfig option was used when adding warning for untested > big-endian capabilities. There is no CONFIG_BIG_ENDIAN option. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/iommu/exynos-iommu.c | 2 +- > 1 file chan

Re: [PATCH kernel v4 4/6] iommu: Set PCI_BUS_FLAGS_MSI_REMAP on iommu driver initialization

2017-07-26 Thread Joerg Roedel
On Wed, Jul 19, 2017 at 08:02:04PM +1000, Alexey Kardashevskiy wrote: > On 11/07/17 05:23, Bjorn Helgaas wrote: > >> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > >> index cf7ca7e70777..0b5881ddca09 100644 > >> --- a/drivers/iommu/iommu.c > >> +++ b/drivers/iommu/iommu.c > >> @@ -106

Re: [PATCH v4 1/2] acpi:iort: Add an IORT helper function to reserve HW ITS address regions for IOMMU drivers

2017-07-26 Thread Lorenzo Pieralisi
On Tue, Jul 25, 2017 at 06:32:40PM +0100, Robin Murphy wrote: > On 25/07/17 18:11, Lorenzo Pieralisi wrote: > > On Tue, Jul 25, 2017 at 12:17:31PM +0100, Shameer Kolothum wrote: > >> The helper function retrieves ITS address regions through IORT > >> device <-> ITS mappings and reserves it so that

Re: [PATCH v2 2/2] iommu/dma: Use __GFP_NOWARN only for high-order allocations

2017-07-26 Thread Tomasz Figa
Hi Joerg, On Wed, Jul 26, 2017 at 6:24 PM, Joerg Roedel wrote: > On Tue, Jul 04, 2017 at 10:55:56PM +0900, Tomasz Figa wrote: >> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c >> index bf23989b5158..6ed8c8f941d8 100644 >> --- a/drivers/iommu/dma-iommu.c >> +++ b/drivers/iommu/

Re: [PATCH] iommu: Correct iommu_map / iommu_unmap prototypes

2017-07-26 Thread Joerg Roedel
On Wed, Jul 05, 2017 at 08:27:53PM +0300, Dmitry Osipenko wrote: > Commit 7d3002cc8c16 ("iommu/core: split mapping to page sizes as supported > by the hardware") replaced 'int gfp_order' with a 'size_t size' of > iommu_map / iommu_unmap function arguments, but missed the function > prototypes for t

Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags

2017-07-26 Thread Tomasz Figa
Hi Joerg, On Wed, Jul 26, 2017 at 6:15 PM, Joerg Roedel wrote: > On Tue, Jul 04, 2017 at 10:55:55PM +0900, Tomasz Figa wrote: >> Current implementation of __iommu_dma_alloc_pages() keeps adding >> __GFP_HIGHMEM to GFP flags regardless of whether other zone flags are >> already included in the inc

Re: [PATCH v2 2/2] iommu/dma: Use __GFP_NOWARN only for high-order allocations

2017-07-26 Thread Joerg Roedel
On Tue, Jul 04, 2017 at 10:55:56PM +0900, Tomasz Figa wrote: > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > index bf23989b5158..6ed8c8f941d8 100644 > --- a/drivers/iommu/dma-iommu.c > +++ b/drivers/iommu/dma-iommu.c > @@ -433,6 +433,7 @@ static struct page **__iommu_dma_allo

Re: [PATCH v2 1/2] iommu/dma: Respect __GFP_DMA and __GFP_DMA32 in incoming GFP flags

2017-07-26 Thread Joerg Roedel
On Tue, Jul 04, 2017 at 10:55:55PM +0900, Tomasz Figa wrote: > Current implementation of __iommu_dma_alloc_pages() keeps adding > __GFP_HIGHMEM to GFP flags regardless of whether other zone flags are > already included in the incoming flags. If __GFP_DMA or __GFP_DMA32 is > set at the same time as

Re: [PATCH] iommu/vt-d: Don't free parent pagetable of the PTE we're adding

2017-07-26 Thread Joerg Roedel
On Wed, Jun 28, 2017 at 07:42:23PM -0700, David Dillow wrote: > When adding a large scatterlist entry that covers more than the L3 > superpage size (1GB) but has an alignment such that we must use L2 > superpages (2MB) , we give dma_pte_free_level() a range that causes it > to free the L3 pagetable

Re: [PATCH] iommu/of: Handle PCI aliases properly

2017-07-26 Thread Joerg Roedel
On Wed, May 31, 2017 at 06:52:29PM +0100, Robin Murphy wrote: > When a PCI device has DMA quirks, we need to ensure that an upstream > IOMMU knows about all possible aliases, since the presence of a DMA > quirk does not preclude the device still also emitting transactions > (e.g. MSIs) on its 'real

Re: [PATCH 3/9] iommu: Introduce iommu do invalidate API function

2017-07-26 Thread Joerg Roedel
On Wed, Jul 05, 2017 at 07:57:57AM +, Tian, Kevin wrote: > > > struct tlb_invalidate_info > > > { > > > __u32 model; /* Vendor number */ I don't like to have a model-specifier here, as I don't think its needed. > > > __u8 granularity > > > #define DEVICE_SELECTVIE_INV(1