Re: [PATCH 17/20] powerpc/dma-swiotlb: use generic swiotlb_dma_ops

2018-08-08 Thread Benjamin Herrenschmidt
On Thu, 2018-08-09 at 10:54 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > > These are identical to the arch specific ones, so remove them. > > > > Signed-off-by: Christoph Hellwig > > Acked-by: Benjamin Herrenschmidt Note: We will still

Re: [PATCH 1/1] iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout

2018-08-08 Thread Leizhen (ThunderTown)
On 2018/8/8 18:12, Will Deacon wrote: > Hi Thunder, > > On Mon, Aug 06, 2018 at 08:31:29PM +0800, Zhen Lei wrote: >> The condition "(int)(VAL - sync_idx) >= 0" to break loop in function >> __arm_smmu_sync_poll_msi requires that sync_idx must be increased >> monotonously according to the

Re: [RFC PATCH 2/7] iommu: Add share domain interface in iommu for spimdev

2018-08-08 Thread Kenneth Lee
On Wed, Aug 08, 2018 at 11:13:54AM +0200, Joerg Roedel wrote: > Date: Wed, 8 Aug 2018 11:13:54 +0200 > From: Joerg Roedel > To: Kenneth Lee > CC: Jonathan Corbet , Herbert Xu > , "David S . Miller" , > Alex Williamson , Kenneth Lee > , Hao Fang , Zhou Wang > , Zaibo Xu , Philippe >

Re: [PATCH 20/20] powerpc/dma: remove dma_nommu_mmap_coherent

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > The remaining implementation for coherent caches is functionally > identical to the default provided in common code. > > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- >

Re: [PATCH 18/20] powerpc/dma-noncoherent: use generic dma_noncoherent_ops

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > The generic dma-noncoherent code provides all that is needed by powerpc. > > Note that the cache maintainance in the existing code is a bit odd > as it implements both the sync_to_device and sync_to_cpu callouts, > but never flushes

Re: [PATCH 17/20] powerpc/dma-swiotlb: use generic swiotlb_dma_ops

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > These are identical to the arch specific ones, so remove them. > > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/include/asm/dma-direct.h | 4 > arch/powerpc/include/asm/swiotlb.h

Re: [PATCH 16/20] powerpc/dma: use dma_direct_{alloc,free}

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > These do the same functionality as the existing helpers, but do it > simpler, and also allow the (optional) use of CMA. > > Note that the swiotlb code now calls into the dma_direct code directly, > given that it doesn't work with

Re: [PATCH 15/20] powerpc/dma: remove the unused unmap_page and unmap_sg methods

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > These methods are optional to start with, no need to implement no-op > versions. > > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/kernel/dma.c | 16 > 1 file changed, 16

Re: [PATCH 14/20] powerpc/dma: replace dma_nommu_dma_supported with dma_direct_supported

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > The ppc32 case of dma_nommu_dma_supported already was a no-op, and the > 64-bit case came to the same conclusion as dma_direct_supported, so > replace it with the generic version. It's not at all equivalent (see my review on your

Re: [PATCH 13/20] powerpc/dma: remove get_dma_offset

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > Just fold the calculation into __phys_to_dma/__dma_to_phys as those are > the only places that should know about it. > > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- >

Re: [PATCH 12/20] powerpc/dma: use phys_to_dma instead of get_dma_offset

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > Use the standard portable helper instead of the powerpc specific one, > which is about to go away. > > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/kernel/dma-swiotlb.c | 5 ++--- >

Re: [PATCH 11/20] powerpc/dma: split the two __dma_alloc_coherent implementations

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > The implemementation for the CONFIG_NOT_COHERENT_CACHE case doesn't share > any code with the one for systems with coherent caches. Split it off > and merge it with the helpers in dma-noncoherent.c that have no other > callers. > >

Re: [PATCH 09/20] powerpc/dma: remove the unused ISA_DMA_THRESHOLD export

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/kernel/setup_32.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c >

Re: [PATCH 08/20] powerpc/dma: remove the unused dma_nommu_ops export

2018-08-08 Thread Benjamin Herrenschmidt
On Tue, 2018-07-31 at 14:16 +0200, Christoph Hellwig wrote: > It turns out cxl actually uses it. So for now skip this patch, > although random code in drivers messing with dma ops will need to > be sorted out sooner or later. CXL devices are "special", they bypass the classic iommu in favor of

Re: [PATCH 07/20] powerpc/dma: remove the unused ARCH_HAS_DMA_MMAP_COHERENT define

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt > --- > arch/powerpc/include/asm/dma-mapping.h | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/dma-mapping.h >

Re: [PATCH 02/20] kernel/dma/direct: refine dma_direct_alloc zone selection

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > We need to take the DMA offset and encryption bit into account when selecting > a zone. Add a helper that takes those into account and use it. That whole "encryption" stuff seems to be completely specific to the way x86 does memory

Re: [PATCH 01/20] kernel/dma/direct: take DMA offset into account in dma_direct_supported

2018-08-08 Thread Benjamin Herrenschmidt
On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > When a device has a DMA offset the dma capable result will change due > to the difference between the physical and DMA address. Take that into > account. The patch in itself makes sense. However, there are a number of things in that

Re: [PATCH 1/2] arm64: dts: stratix10: Add Stratix10 SMMU support

2018-08-08 Thread Robin Murphy
On 25/07/18 19:24, thor.tha...@linux.intel.com wrote: From: Thor Thayer Add SMMU support to the Stratix10 Device Tree which includes adding the SMMU node and adding IOMMU stream ids to the SMMU peripherals. Update bindings. Signed-off-by: Thor Thayer --- This patch is dependent on the patch

Re: [RFC PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-08-08 Thread Jerome Glisse
On Wed, Aug 08, 2018 at 09:08:42AM +0800, Kenneth Lee wrote: > > > 在 2018年08月06日 星期一 11:32 下午, Jerome Glisse 写道: > > On Mon, Aug 06, 2018 at 11:12:52AM +0800, Kenneth Lee wrote: > > > On Fri, Aug 03, 2018 at 10:39:44AM -0400, Jerome Glisse wrote: > > > > On Fri, Aug 03, 2018 at 11:47:21AM +0800,

Re: [PATCH v3 08/10] dmapool: improve accuracy of debug statistics

2018-08-08 Thread Tony Battersby
On 08/08/2018 05:54 AM, Andy Shevchenko wrote: > On Tue, Aug 7, 2018 at 7:49 PM, Tony Battersby wrote: >> The "total number of blocks in pool" debug statistic currently does not >> take the boundary value into account, so it diverges from the "total >> number of blocks in use" statistic when a

Re: [PATCH 1/1] iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout

2018-08-08 Thread Will Deacon
Hi Thunder, On Mon, Aug 06, 2018 at 08:31:29PM +0800, Zhen Lei wrote: > The condition "(int)(VAL - sync_idx) >= 0" to break loop in function > __arm_smmu_sync_poll_msi requires that sync_idx must be increased > monotonously according to the sequence of the CMDs in the cmdq. > > But ".msidata =

Re: [PATCH v3 08/10] dmapool: improve accuracy of debug statistics

2018-08-08 Thread Andy Shevchenko
On Tue, Aug 7, 2018 at 7:49 PM, Tony Battersby wrote: > The "total number of blocks in pool" debug statistic currently does not > take the boundary value into account, so it diverges from the "total > number of blocks in use" statistic when a boundary is in effect. Add a > calculation for the

Re: [PATCH v3 07/10] dmapool: cleanup integer types

2018-08-08 Thread Andy Shevchenko
On Tue, Aug 7, 2018 at 7:48 PM, Tony Battersby wrote: > To represent the size of a single allocation, dmapool currently uses > 'unsigned int' in some places and 'size_t' in other places. Standardize > on 'unsigned int' to reduce overhead, but use 'size_t' when counting all > the blocks in the

Re: [PATCH v2 0/8] Tegra GART driver clean up and optimization

2018-08-08 Thread Joerg Roedel
Hey Thierry, On Sat, Aug 04, 2018 at 05:29:55PM +0300, Dmitry Osipenko wrote: > Dmitry Osipenko (8): > memory: tegra: Provide facility for integration with the GART driver > iommu/tegra: gart: Provide access to Memory Controller driver > iommu/tegra: gart: Clean up drivers module code >

Re: [RFC PATCH 2/7] iommu: Add share domain interface in iommu for spimdev

2018-08-08 Thread Joerg Roedel
On Wed, Aug 01, 2018 at 06:22:16PM +0800, Kenneth Lee wrote: > From: Kenneth Lee > > This patch add sharing interface for a iommu_group. The new interface: > > iommu_group_share_domain() > iommu_group_unshare_domain() > > can be used by some virtual iommu_group (such as iommu_group

Re: [PATCH] iommu/omap: Fix cache flushes on L2 table entries

2018-08-08 Thread 'Joerg Roedel'
On Mon, Aug 06, 2018 at 05:00:36PM +0200, Ralf Goebel wrote: > The base address used for DMA operations on the second-level table > did incorrectly include the offset for the table entry. The offset > was then added again which lead to incorrect behavior. > > Operations on the L1 table are not

Re: [PATCH] iommu: remove the ->map_sg indirection

2018-08-08 Thread Joerg Roedel
On Mon, Jul 30, 2018 at 09:36:26AM +0200, Christoph Hellwig wrote: > All iommu drivers use the default_iommu_map_sg implementation, and there > is no good reason to ever override it. Just expose it as iommu_map_sg > directly and remove the indirection, specially in our post-spectre world > where

Re: [PATCH 1/2] iommu/rockchip: Handle errors returned from PM framework

2018-08-08 Thread Heiko Stuebner
Am Dienstag, 7. August 2018, 10:54:05 CEST schrieb Marc Zyngier: > pm_runtime_get_if_in_use can fail: either PM has been disabled > altogether (-EINVAL), or the device hasn't been enabled yet (0). > Sadly, the Rockchip IOMMU driver tends to conflate the two things > by considering a non-zero

Re: [PATCH 1/2] iommu/rockchip: Handle errors returned from PM framework

2018-08-08 Thread Heiko Stuebner
Am Dienstag, 7. August 2018, 16:25:53 CEST schrieb Marc Zyngier: > On 07/08/18 14:15, Heiko Stuebner wrote: > > Am Dienstag, 7. August 2018, 14:31:49 CEST schrieb Marc Zyngier: > >> On 07/08/18 13:09, Heiko Stuebner wrote: > >>> Hi Marc, > >>> > >>> Am Dienstag, 7. August 2018, 10:54:05 CEST

Re: [PATCH 1/3] hexagon: remove the sync_single_for_cpu DMA operation

2018-08-08 Thread Christoph Hellwig
On Tue, Aug 07, 2018 at 07:19:27PM -0500, Richard Kuo wrote: > I am here, and I have the patch queued up but it's waiting for approval > before I get to push it out through my tree. > > That said, I am perfectly fine with this going through a different tree > if expedience is needed. I just want