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

2014-08-18 Thread Marek Szyprowski
Hello, On 2014-08-19 01:32, Joerg Roedel wrote: On Tue, Aug 05, 2014 at 12:47:28PM +0200, Marek Szyprowski wrote: .../devicetree/bindings/iommu/samsung,sysmmu.txt | 93 ++- Documentation/power/notifiers.txt | 14 + arch/arm/boot/dts/exynos4.dtsi | 11

Re: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Li, ZhenHua
I found there are more data need to be cleared for the dump kernel. So please ignore this patch, I will send out another one. Thanks Zhenhua On 08/19/2014 07:59 AM, Li, Zhen-Hua wrote: My debugging result is this: 1. Clear the old root entry table, dump kernel will choose another memory regi

RE: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Li, Zhen-Hua
My debugging result is this: 1. Clear the old root entry table, dump kernel will choose another memory region for root entry. 2. Do NOT clear the old root entry, when dump kernel initializing the iommu data structure, it will allocate memory for root entry, this is different from the old addr

RE: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Li, Zhen-Hua
When the dump kernel boots, it will initialize iommu again, and the root entry will be allocted in another memory region. That means, no matter kernel clears the old root entry table or not, the dump kernel will use another memory region when iommu initializing. -Original Message- Fr

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

2014-08-18 Thread Joerg Roedel
On Tue, Aug 05, 2014 at 12:47:28PM +0200, Marek Szyprowski wrote: > .../devicetree/bindings/iommu/samsung,sysmmu.txt | 93 ++- > Documentation/power/notifiers.txt | 14 + > arch/arm/boot/dts/exynos4.dtsi | 118 > arch/arm/boot/dts/exynos4210.dtsi

RE: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Li, Zhen-Hua
: [fault reason 01] Present bit in root entry is clear It appears when iommu initializing in the kdump kernel. -Original Message- From: Joerg Roedel [mailto:j...@8bytes.org] Sent: Tuesday, August 19, 2014 7:23 AM To: Li, Zhen-Hua Cc: David Woodhouse; iommu@lists.linux-foundation.org; lin

Re: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Joerg Roedel
On Mon, Aug 18, 2014 at 11:01:56PM +, Li, Zhen-Hua wrote: > There is a bug when Linux running on an HP large system: > when kdump kernel runs, the hardware is still using the old > root entry. This causes error message when iommu not finished initialization. What error message are you

[PATCH v3 1/1] iommu/arm-smmu: Do not access non-existing S2CR registers

2014-08-18 Thread Olav Haugan
The number of S2CR registers is not properly set when stream matching is not supported. Fix this and add check that we do not try to access outside of the number of S2CR regisrers. Signed-off-by: Olav Haugan --- drivers/iommu/arm-smmu.c | 24 +--- 1 file changed, 17 insertion

RE: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Li, Zhen-Hua
There is a bug when Linux running on an HP large system: when kdump kernel runs, the hardware is still using the old root entry. This causes error message when iommu not finished initialization. -Original Message- From: Li, Zhen-Hua Sent: Monday, August 18, 2014 4:59 PM To: Davi

[PATCH 1/3] iommu/vt-d: Defer domain removal if device is assigned to a driver

2014-08-18 Thread Joerg Roedel
From: Joerg Roedel When the BUS_NOTIFY_DEL_DEVICE event is received the device might still be attached to a driver. In this case the domain can't be released as the mappings might still be in use. Defer the domain removal in this case until we receivce the BUS_NOTIFY_UNBOUND_DRIVER event. Cc: J

[PATCH 0/3] IOMMU Fixes

2014-08-18 Thread Joerg Roedel
Hi, here are a few fixes for the x86 iommu drivers and a small one for the iommu core-code I plan to send for -rc2. Joerg Joerg Roedel (3): iommu/vt-d: Defer domain removal if device is assigned to a driver iommu/amd: Fix cleanup_domain for mass device removal iommu/core: Check fo

[PATCH 3/3] iommu/core: Check for the right function pointer in iommu_map()

2014-08-18 Thread Joerg Roedel
From: Joerg Roedel Check for the ->map and not the ->unmap pointer. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 1698360..ac4adb3 100644 --- a/drivers/iommu/iommu.c

[PATCH 2/3] iommu/amd: Fix cleanup_domain for mass device removal

2014-08-18 Thread Joerg Roedel
From: Joerg Roedel When multiple devices are detached in __detach_device, they are also removed from the domains dev_list. This makes it unsafe to use list_for_each_entry_safe, as the next pointer might also not be in the list anymore after __detach_device returns. So just repeatedly remove the f

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread Olav Haugan
On 8/18/2014 2:55 PM, Joerg Roedel wrote: > On Mon, Aug 11, 2014 at 03:45:50PM -0700, Olav Haugan wrote: >> +int default_iommu_map_sg(struct iommu_domain *domain, unsigned long iova, >> + struct scatterlist *sg, unsigned int nents, >> + int prot, unsigned lon

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread Joerg Roedel
On Mon, Aug 11, 2014 at 03:45:50PM -0700, Olav Haugan wrote: > +int default_iommu_map_sg(struct iommu_domain *domain, unsigned long iova, > + struct scatterlist *sg, unsigned int nents, > + int prot, unsigned long flags) > +{ > + int ret = 0; > + un

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread Olav Haugan
On 8/18/2014 2:26 PM, j...@8bytes.org wrote: > On Mon, Aug 18, 2014 at 01:48:46PM -0700, Olav Haugan wrote: >> On 8/18/2014 11:32 AM, Rob Clark wrote: > >> No, I do not have other uses right now. But could imagine use cases like >> "force mapping" flag etc. > > I think it is worth discussing to

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread j...@8bytes.org
On Mon, Aug 18, 2014 at 01:48:46PM -0700, Olav Haugan wrote: > On 8/18/2014 11:32 AM, Rob Clark wrote: > No, I do not have other uses right now. But could imagine use cases like > "force mapping" flag etc. I think it is worth discussing to add a flush() function to the IOMMU-API. I sent a patch-

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread Olav Haugan
On 8/18/2014 11:32 AM, Rob Clark wrote: > On Mon, Aug 18, 2014 at 10:07 AM, j...@8bytes.org wrote: >> On Tue, Aug 12, 2014 at 09:56:11AM -0700, Olav Haugan wrote: >>> On 8/12/2014 3:48 AM, Rob Clark wrote: iirc, one plan for 'flags' was some sort of DONT_FLUSH_TLB flag for drivers which

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread Rob Clark
On Mon, Aug 18, 2014 at 10:07 AM, j...@8bytes.org wrote: > On Tue, Aug 12, 2014 at 09:56:11AM -0700, Olav Haugan wrote: >> On 8/12/2014 3:48 AM, Rob Clark wrote: >> > iirc, one plan for 'flags' was some sort of DONT_FLUSH_TLB flag for >> > drivers which wanted to map/unmap N buffers with a single

Re: [PATCH 2/2] iommu: Implement a dummy bus_set_iommu()

2014-08-18 Thread Joerg Roedel
On Fri, Aug 01, 2014 at 02:45:13PM +0200, Thierry Reding wrote: > From: Thierry Reding > > This allows IOMMU drivers to compile even if IOMMU_API is not selected > and helps improve compile coverage. IOMMU drivers usually implement the IOMMU-API, so they have a strong dependency to it. Why do yo

Re: [PATCH] iommu/msm: Switch to using managed resources

2014-08-18 Thread Joerg Roedel
On Mon, Aug 04, 2014 at 05:37:37PM +0530, Pramod Gurav wrote: > This switches the driver to using managed resources to simplify error > handling and to do away with remove function. > > CC: Stepan Moskovchenko > CC: Joerg Roedel > CC: Stephen Boyd > Signed-off-by: Pramod Gurav > --- > drivers

[PATCH] iommu: Replace rcu_assign_pointer() with RCU_INIT_POINTER()

2014-08-18 Thread Andreea-Cristina Bernat
The use of "rcu_assign_pointer()" is NULLing out the pointer. According to RCU_INIT_POINTER()'s block comment: "1. This use of RCU_INIT_POINTER() is NULLing out the pointer" it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. The following Coccinelle semanti

Re: [PATCH v5 1/1] iommu-api: Add map_sg/unmap_sg functions

2014-08-18 Thread j...@8bytes.org
On Tue, Aug 12, 2014 at 09:56:11AM -0700, Olav Haugan wrote: > On 8/12/2014 3:48 AM, Rob Clark wrote: > > iirc, one plan for 'flags' was some sort of DONT_FLUSH_TLB flag for > > drivers which wanted to map/unmap N buffers with a single flush at the > > end. There might have been some other usages

Re: [PATCH 03/29] clk: exynos: add missing smmu_g2d clock and update comments

2014-08-18 Thread Tomasz Figa
On 05.08.2014 12:47, Marek Szyprowski wrote: > 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 Szyprow

[PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Li, Zhen-Hua
If intel_iommu is enabled, when kdump kernel boots, the old root entry should be cleared, otherwise it may cause DMAR error. To make it works for more enviroments, this patch does not use is_kdump_kernel() to check it, but reads the register to check whether hardware is using old root entry.