Re: [PATCH 4/8] iommu/arm-smmu: set EPD1 to disable TT1 translation table walk

2015-06-29 Thread leizhen
On 2015/6/30 1:26, Will Deacon wrote: > On Fri, Jun 26, 2015 at 09:33:00AM +0100, Zhen Lei wrote: >> Now we only use TT0 translation, disable TT1 translation will safer. >> >> Signed-off-by: Zhen Lei >> --- >> drivers/iommu/arm-smmu-v3.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [PATCH 3/8] iommu/arm-smmu: fix the values of ARM64_TCR_IRGN0_SHIFT and ARM64_TCR_ORGN0_SHIFT

2015-06-29 Thread leizhen
On 2015/6/30 1:25, Will Deacon wrote: > On Fri, Jun 26, 2015 at 09:32:59AM +0100, Zhen Lei wrote: >> In context descriptor, the offset of IR0 is 8, the offset of OR0 is 10. >> >> Signed-off-by: Zhen Lei >> --- >> drivers/iommu/arm-smmu-v3.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletion

Re: [PATCH 1/8] iommu/arm-smmu: fix the assignment of log2size field

2015-06-29 Thread leizhen
On 2015/6/30 1:05, Will Deacon wrote: > Hi Zhen Lei, > > On Fri, Jun 26, 2015 at 09:32:57AM +0100, Zhen Lei wrote: >> Add a new local variable to store the value of log2size, so that it will >> not be overridden by L1 table size. >> >> Signed-off-by: Zhen Lei >> --- >> drivers/iommu/arm-smmu-v3.

Re: [PATCH 03/22] iommu: Propagate error in add_iommu_group

2015-06-29 Thread Heiko Stübner
Hi Joerg, Am Montag, 29. Juni 2015, 16:06:37 schrieb Joerg Roedel: > On Mon, Jun 29, 2015 at 11:28:40AM +0200, Heiko Stübner wrote: > > The Rockchip iommu uses bus_set_ops to set its iommu-ops for the platform > > bus and currently returns -ENODEV if it encounters a platform_devices that > > does

Re: [PATCH 0/2] iommu/arm-smmu: fixes for 4.2

2015-06-29 Thread Joerg Roedel
Hi Will, On Mon, Jun 29, 2015 at 05:47:41PM +0100, Will Deacon wrote: > Since you're sending a batch of IOMMU fixes tomorrow, could you include > these two ARM SMMU fixes as well please? Sure, applied directly to my 'next' branch too. Joerg _

Re: dma_ops_domain_alloc causes kernel 4.1.0-next-20150626+ panic

2015-06-29 Thread Joerg Roedel
On Tue, Jun 30, 2015 at 01:44:34AM +0800, George Wang wrote: > diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c > index d3e5e9a..4f6da17 100644 > --- a/drivers/iommu/amd_iommu.c > +++ b/drivers/iommu/amd_iommu.c > @@ -1882,6 +1882,7 @@ static struct dma_ops_domain *dma_ops_domain_

Re: [PATCH 8/8] iommu/arm-smmu: suppress fault information about CMD_PREFETCH_CONFIG execution

2015-06-29 Thread Will Deacon
On Fri, Jun 26, 2015 at 09:33:04AM +0100, Zhen Lei wrote: > Some broken SMMUv3 devices treat CMD_PREFETCH_CONFIG as illegal command, > it's ugly to print error information. CMD_PREFETCH_CONFIG is just used to > prefetch the configuration for a specified StreamID, without this command > will not imp

Re: [PATCH 7/8] iommu/arm-smmu: enlarge STRTAB_L1_SZ_SHIFT to support larger sidsize

2015-06-29 Thread Will Deacon
On Fri, Jun 26, 2015 at 09:33:03AM +0100, Zhen Lei wrote: > Because we will choose the minimum value between STRTAB_L1_SZ_SHIFT and > IDR1.SIDSIZE, so enlarge STRTAB_L1_SZ_SHIFT will not impact the platforms > whose IDR1.SIDSIZE is smaller than old STRTAB_L1_SZ_SHIFT value. > > Signed-off-by: Zhen

Re: [PATCH 6/8] iommu/arm-smmu: add support for non-pci devices

2015-06-29 Thread Will Deacon
On Fri, Jun 26, 2015 at 09:33:02AM +0100, Zhen Lei wrote: > Now, we only support a master with only one stream id. It will cover most > hardware platforms and coding so easy. > > Please refer Documentation\devicetree\bindings\iommu\iommu.txt on how to > bind device tree. Can you build this on top

Re: [PATCH 4/8] iommu/arm-smmu: set EPD1 to disable TT1 translation table walk

2015-06-29 Thread Will Deacon
On Fri, Jun 26, 2015 at 09:33:00AM +0100, Zhen Lei wrote: > Now we only use TT0 translation, disable TT1 translation will safer. > > Signed-off-by: Zhen Lei > --- > drivers/iommu/arm-smmu-v3.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/arm-smmu-v3.c

Re: [PATCH 3/8] iommu/arm-smmu: fix the values of ARM64_TCR_IRGN0_SHIFT and ARM64_TCR_ORGN0_SHIFT

2015-06-29 Thread Will Deacon
On Fri, Jun 26, 2015 at 09:32:59AM +0100, Zhen Lei wrote: > In context descriptor, the offset of IR0 is 8, the offset of OR0 is 10. > > Signed-off-by: Zhen Lei > --- > drivers/iommu/arm-smmu-v3.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/arm-smmu

Re: [PATCH 2/8] iommu/arm-smmu: fix the index calculation of strtab

2015-06-29 Thread Will Deacon
On Fri, Jun 26, 2015 at 09:32:58AM +0100, Zhen Lei wrote: > The element size of cfg->strtab is just one DWORD, should use multiply > operation. Nice catch. Turns out all my emulated PCI devices sit on bus 0, so this didn't show up in testing. Will > Signed-off-by: Zhen Lei > --- > drivers/iomm

Re: [PATCH 1/8] iommu/arm-smmu: fix the assignment of log2size field

2015-06-29 Thread Will Deacon
Hi Zhen Lei, On Fri, Jun 26, 2015 at 09:32:57AM +0100, Zhen Lei wrote: > Add a new local variable to store the value of log2size, so that it will > not be overridden by L1 table size. > > Signed-off-by: Zhen Lei > --- > drivers/iommu/arm-smmu-v3.c | 14 +++--- > 1 file changed, 7 insert

[PATCH 2/2] iommu/arm-smmu: Delete an unnecessary check before the function call "free_io_pgtable_ops"

2015-06-29 Thread Will Deacon
From: Markus Elfring The free_io_pgtable_ops() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Will Deacon --- drivers

[PATCH 1/2] iommu/arm-smmu: Fix broken ATOS check

2015-06-29 Thread Will Deacon
Commit 83a60ed8f0b5 ("iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS condition") accidentally negated the ID0_ATOSNS predicate in the ATOS feature check, causing the driver to attempt ATOS requests on SMMUv2 hardware without the ATOS feature implemented. This patch restores the predicate to the corre

[PATCH 0/2] iommu/arm-smmu: fixes for 4.2

2015-06-29 Thread Will Deacon
Hi Joerg, Since you're sending a batch of IOMMU fixes tomorrow, could you include these two ARM SMMU fixes as well please? Cheers, Will --->8 Markus Elfring (1): iommu/arm-smmu: Delete an unnecessary check before the function call "free_io_pgtable_ops" Will Deacon (1): iommu/arm-smmu:

Re: [PATCH 03/22] iommu: Propagate error in add_iommu_group

2015-06-29 Thread Joerg Roedel
On Mon, Jun 29, 2015 at 11:28:40AM +0200, Heiko Stübner wrote: > The Rockchip iommu uses bus_set_ops to set its iommu-ops for the platform > bus and currently returns -ENODEV if it encounters a platform_devices that > does not have an iommu. As add_iommu_group ignored these returns > till now this

Re: [PATCH] iommu: Ignore -ENODEV errors from add_device call-back returning -ENODEV

2015-06-29 Thread Joerg Roedel
On Mon, Jun 29, 2015 at 10:53:43AM +0200, Marek Szyprowski wrote: > On 2015-06-29 10:35, Joerg Roedel wrote: > >The -ENODEV error just means that the device is not > >translated by an IOMMU. We shouldn't bail out of iommu > >driver initialization when that happens, as this is a common > >scenario o

Re: [PATCH 03/22] iommu: Propagate error in add_iommu_group

2015-06-29 Thread Joerg Roedel
Hello Heiko, On Mon, Jun 29, 2015 at 11:28:40AM +0200, Heiko Stübner wrote: > The Rockchip iommu uses bus_set_ops to set its iommu-ops for the platform > bus and currently returns -ENODEV if it encounters a platform_devices that > does not have an iommu. As add_iommu_group ignored these returns >

Re: [PATCH 03/22] iommu: Propagate error in add_iommu_group

2015-06-29 Thread Heiko Stübner
Hi Joerg, Am Donnerstag, 28. Mai 2015, 18:41:26 schrieb Joerg Roedel: > From: Joerg Roedel > > Make sure any errors reported from the IOMMU drivers get > progapated back to the IOMMU core. > > Signed-off-by: Joerg Roedel sorry that this series slipped through my inbox without testing somehow

Re: [PATCH] iommu: Ignore -ENODEV errors from add_device call-back returning -ENODEV

2015-06-29 Thread Marek Szyprowski
Hello, On 2015-06-29 10:35, Joerg Roedel wrote: Hi Marek, On Thu, Jun 25, 2015 at 03:10:44PM +0200, Marek Szyprowski wrote: + /* skip devices which doesn't have sysmmu controller */ if (!has_sysmmu(dev)) - return -ENODEV; + return 0; Thanks for report

[PATCH] iommu: Ignore -ENODEV errors from add_device call-back returning -ENODEV

2015-06-29 Thread Joerg Roedel
Hi Marek, On Thu, Jun 25, 2015 at 03:10:44PM +0200, Marek Szyprowski wrote: > + /* skip devices which doesn't have sysmmu controller */ > if (!has_sysmmu(dev)) > - return -ENODEV; > + return 0; Thanks for reporting this! But I think that the -ENODEV return value