Re: [PATCHv7 4/6] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-06-01 Thread Russell King - ARM Linux
On Wed, Jun 01, 2016 at 05:22:27PM +0200, Niklas Söderlund wrote: > +static dma_addr_t arm_iommu_map_resource(struct device *dev, > + phys_addr_t phys_addr, size_t size, > + enum dma_data_direction dir, struct dma_attrs *attrs) > +{ > + struct dma_iommu_mapping *mapping

Re: [PATCH 3/4] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0

2016-06-01 Thread Scott Wood
On Mon, 2016-05-30 at 15:16 +0200, Arnd Bergmann wrote: > This is a rewrite of an earlier patch from Yangbo Lu, adding a quirk > for the NXP QorIQ T4240 in the detection of the host device version. > > Unfortunately, this device cannot be detected using the compatible > string, as we have to

Re: [PATCH 4/4] Revert "powerpc/fsl: Move fsl_guts.h out of arch/powerpc"

2016-06-01 Thread Scott Wood
On Mon, 2016-05-30 at 15:18 +0200, Arnd Bergmann wrote: > All users of this driver are PowerPC specific and the header file > has no business in the global include/linux/ hierarchy, so move > it back before anyone starts using it on ARM. > > This reverts commit

Re: [PATCHv7 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-01 Thread Vinod Koul
On Wed, Jun 01, 2016 at 05:22:23PM +0200, Niklas Söderlund wrote: > Hi, > > [In this v7 series I have tried to address the questions raised by Christoph > Hellwig and I hope it can awnser your concernes regarding dma-debug.] > > This series tries to solve the problem with DMA with device

Re: [PATCH 2/4] soc: fsl: add GUTS driver for QorIQ platforms

2016-06-01 Thread Scott Wood
On Mon, 2016-05-30 at 15:15 +0200, Arnd Bergmann wrote: > diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c > new file mode 100644 > index ..2f30698f5bcf > --- /dev/null > +++ b/drivers/soc/fsl/guts.c > @@ -0,0 +1,130 @@ > +/* > + * Freescale QorIQ Platforms GUTS Driver > +

Re: [RFT v3] drm: use late_initcall() for amdkfd and radeon

2016-06-01 Thread Luis R. Rodriguez
On Tue, May 31, 2016 at 09:04:53PM +0200, Daniel Vetter wrote: > On Tue, May 31, 2016 at 06:58:34PM +0200, Luis R. Rodriguez wrote: > > On Sun, May 29, 2016 at 08:27:07PM +0200, Daniel Vetter wrote: > > > On Fri, May 27, 2016 at 3:18 AM, Luis R. Rodriguez > > > wrote: > > > >

Re: [RFC v2] dma-mapping: Use unsigned long for dma_attrs

2016-06-01 Thread Christoph Hellwig
On Wed, Jun 01, 2016 at 07:36:42AM +0200, Krzysztof Kozlowski wrote: > > No really for this patch, but I would much prefer to document them next > > to the code in the long run. Also I really think these BIT() macros > > are a distraction compared to the (1 << N) notation. > > Not much

Re: [RFC v2] dma-mapping: Use unsigned long for dma_attrs

2016-06-01 Thread Krzysztof Kozlowski
On 05/31/2016 08:15 PM, Konrad Rzeszutek Wilk wrote: > On Mon, May 30, 2016 at 01:54:06PM +0200, Krzysztof Kozlowski wrote: >> The dma-mapping core and the implementations do not change the >> DMA attributes passed by pointer. Thus the pointer can point to const >> data. However the attributes

Re: [PATCH v3 1/2] iommu: Disable preemption around use of this_cpu_ptr()

2016-06-01 Thread Joonas Lahtinen
On ke, 2016-06-01 at 12:10 +0100, Chris Wilson wrote: > Between acquiring the this_cpu_ptr() and using it, ideally we don't want > to be preempted and work on another CPU's private data. this_cpu_ptr() > checks whether or not preemption is disable, and get_cpu_ptr() provides > a convenient wrapper

Re: [PATCH v3 2/2] iommu: Remove cpu-local spinlock

2016-06-01 Thread Joonas Lahtinen
On ke, 2016-06-01 at 12:10 +0100, Chris Wilson wrote: > By avoiding cross-CPU usage of the per-cpu iova cache, we can forgo > having a spinlock inside the per-cpu struct. The only place where we > actually may touch another CPU's data is when performing a cache flush > after running out of memory.

[PATCHv7 3/6] dma-mapping: add dma_{map,unmap}_resource

2016-06-01 Thread Niklas Söderlund
Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund --- Documentation/DMA-API.txt | 22 +- include/linux/dma-mapping.h | 36

[PATCHv7 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-01 Thread Niklas Söderlund
Hi, [In this v7 series I have tried to address the questions raised by Christoph Hellwig and I hope it can awnser your concernes regarding dma-debug.] This series tries to solve the problem with DMA with device registers (MMIO registers) that are behind an IOMMU for the rcar-dmac driver. A

[PATCHv7 1/6] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-06-01 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart ---

[PATCHv7 2/6] dma-debug: add support for resource mappings

2016-06-01 Thread Niklas Söderlund
A MMIO mapped resource can not be represented by a struct page so a new debug type is needed to handle this. This patch add such type and functionality to add/remove entries and how to translate them to a physical address. Signed-off-by: Niklas Söderlund

[PATCHv7 4/6] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-06-01 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart

[PATCHv7 5/6] dmaengine: rcar-dmac: group slave configuration

2016-06-01 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart

[PATCHv7 6/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-01 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74

[RESEND PATCH] iommu/rockchip: fix zap cache during device attach

2016-06-01 Thread John Keeping
rk_iommu_command() takes a struct rk_iommu and iterates over the slave MMUs, so this is doubly wrong in that we're passing in the wrong pointer and talking to MMUs that we shouldn't be. Fixes: cd6438c5f844 ("iommu/rockchip: Reconstruct to support multi slaves") Cc: sta...@vger.kernel.org