[PATCH V2] iommu: arm-smmu: drop devm_free_irq when driver detach

2016-07-12 Thread Peng Fan
There is no need to call devm_free_irq when driver detach. devres_release_all which is called after 'drv->remove' will release all managed resources. Signed-off-by: Peng Fan Reviewed-by: Robin Murphy Cc: Will Deacon --- V2:

[PATCH v2] iommu/arm-smmu-v3: limit use of 2-level stream tables

2016-07-12 Thread Nate Watterson
In the current arm-smmu-v3 driver, all smmus that support 2-level stream tables are being forced to use them. This is suboptimal for smmus that support fewer stream id bits than would fill in a single second level table. This patch limits the use of 2-level tables to smmus that both support the

Re: [PATCH 16/20 v2] iommu/amd: Optimize map_sg and unmap_sg

2016-07-12 Thread Robin Murphy
On 12/07/16 14:30, Joerg Roedel wrote: > On Tue, Jul 12, 2016 at 12:33:43PM +0100, Robin Murphy wrote: >>> + for_each_sg(sglist, s, nelems, i) >>> + npages += iommu_num_pages(sg_phys(s), s->length, PAGE_SIZE); >> >> This fails to account for the segment boundary mask[1]. Given a

Re: [PATCH v5 24/44] iommu: intel: dma-mapping: Use unsigned long for dma_attrs

2016-07-12 Thread Joerg Roedel
On Thu, Jun 30, 2016 at 10:25:51AM +0200, Krzysztof Kozlowski wrote: > Split out subsystem specific changes for easier reviews. This will be > squashed with main commit. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/iommu/intel-iommu.c | 12 ++-- > 1

Re: [PATCH v5 17/44] iommu: dma-mapping: Use unsigned long for dma_attrs

2016-07-12 Thread Joerg Roedel
On Thu, Jun 30, 2016 at 10:25:44AM +0200, Krzysztof Kozlowski wrote: > Split out subsystem specific changes for easier reviews. This will be > squashed with main commit. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/iommu/amd_iommu.c | 12 ++-- >

Re: [PATCH v5 00/44] dma-mapping: Use unsigned long for dma_attrs

2016-07-12 Thread Krzysztof Kozlowski
On 07/12/2016 02:16 PM, Daniel Vetter wrote: > On Thu, Jun 30, 2016 at 10:23:39AM +0200, Krzysztof Kozlowski wrote: >> Hi, >> >> >> This is fifth approach for replacing struct dma_attrs with unsigned >> long. >> >> The main patch (1/44) doing the change is split into many subpatches >> for easier

Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Joerg Roedel
Hi Robin, On Tue, Jul 12, 2016 at 12:42:59PM +0100, Robin Murphy wrote: > Ah, that's the angle I was missing, yes. So if, say, someone is mapping > a page at IOVA 0x while someone else is mapping a page at 0x1000, > there could still be a race between both callers writing the non-leaf > PTEs,

Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Robin Murphy
On 12/07/16 12:08, Joerg Roedel wrote: > Hi Robin, > > On Tue, Jul 12, 2016 at 11:55:39AM +0100, Robin Murphy wrote: >>> start = address; >>> for (i = 0; i < pages; ++i) { >>> - ret = dma_ops_domain_map(dma_dom, start, paddr, dir); >>> - if (ret == DMA_ERROR_CODE) >>>

Re: [PATCH 16/20] iommu/amd: Optimize map_sg and unmap_sg

2016-07-12 Thread Robin Murphy
On 08/07/16 12:45, Joerg Roedel wrote: > From: Joerg Roedel > > Optimize these functions so that they need only one call > into the address alloctor. This also saves a couple of > io-tlb flushes in the unmap_sg path. > > Signed-off-by: Joerg Roedel > --- >

Re: [GIT PULL] iommu/arm-smmu: Updates for 4.8

2016-07-12 Thread Joerg Roedel
On Fri, Jul 08, 2016 at 04:59:46PM +0100, Will Deacon wrote: > The following changes since commit af8c34ce6ae32addda3788d54a7e340cad22516b: > > Linux 4.7-rc2 (2016-06-05 14:31:26 -0700) > > are available in the git repository at: > >

Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Joerg Roedel
Hi Robin, On Tue, Jul 12, 2016 at 11:55:39AM +0100, Robin Murphy wrote: > > start = address; > > for (i = 0; i < pages; ++i) { > > - ret = dma_ops_domain_map(dma_dom, start, paddr, dir); > > - if (ret == DMA_ERROR_CODE) > > + ret =

Re: [PATCH 00/20] iommu/amd: Use generic IOVA allocator

2016-07-12 Thread Joerg Roedel
Hey Vincent, On Tue, Jul 12, 2016 at 05:03:08PM +0800, Wan Zongshun wrote: > Currently, those patches can not work at my eCarrizo board. > When I merged your patches, boot failed, and no any info print to me. > I set iommu=pt, it also does not work; set iommu=soft, boot ok. > > When I removed

Re: [PATCH] iommu: arm-smmu: drop devm_free_irq when driver detach

2016-07-12 Thread Robin Murphy
On 12/07/16 02:33, Peng Fan wrote: > There is no need to call devm_free_irq when driver detach. > devres_release_all which is called after 'drv->remove' will > release all managed resources. > > Signed-off-by: Peng Fan > Cc: Will Deacon > Cc: Robin

Re: [PATCH] iommu/arm-smmu-v3: limit use of 2-level stream tables

2016-07-12 Thread Robin Murphy
On 11/07/16 19:00, Nate Watterson wrote: > In the current arm-smmu-v3 driver, all smmus that support 2-level > stream tables are being forced to use them. This is suboptimal for > smmus that support fewer stream id bits than would fill in a single > second level table. This patch limits the use of