Re: [RFC PATCH 2/3] iommu: Create basic group infrastructure and update AMD-Vi & Intel VT-d

2012-04-18 Thread Alex Williamson
On Wed, 2012-04-18 at 21:55 +1000, David Gibson wrote: > On Mon, Apr 02, 2012 at 03:14:46PM -0600, Alex Williamson wrote: > > IOMMU groups define the minimum granularity of the IOMMU. We therefore > > create groups using a dma_dev which is the effective requestor ID for > > the entire group. Addi

Re: [RFC PATCH 1/3] iommu: Introduce iommu_group

2012-04-18 Thread Alex Williamson
On Wed, 2012-04-18 at 19:58 +1000, David Gibson wrote: > On Mon, Apr 02, 2012 at 03:14:40PM -0600, Alex Williamson wrote: > > IOMMUs often do not have visibility of individual devices in the > > system. Due to IOMMU design, bus topology, or device quirks, we > > can often only identify groups of d

Re: [PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Thierry Reding
* Stephen Warren wrote: > On 04/18/2012 04:19 AM, Hiroshi Doyu wrote: > > > Subject: [PATCH 1/1] dt: Add general DMA window parser > > > > This code was stolen from: > > "arch/microblaze/kernel/prom_parse.c" > > "arch/powerpc/kernel/prom_parse.c" > > > > Once "ibm," prefix is removed fro

Re: [PATCH] iommu: OMAP: device detach on domain destroy

2012-04-18 Thread Omar Ramirez Luna
Hi Joerg, On 12 April 2012 05:25, Joerg Roedel wrote: > Doesn't apply against 3.4-rc2. Please rebase and send a new version. I rebased the patch and sent v2. Thanks, Omar ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoun

[PATCH v2] iommu: OMAP: device detach on domain destroy

2012-04-18 Thread Omar Ramirez Luna
'domain_destroy with devices attached' case isn't yet handled, instead code assumes that the device was already detached. If the domain is destroyed the hardware still has access to invalid pointers to its page table and internal iommu object. In order to detach the users we need to track devices

Re: [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU

2012-04-18 Thread Stephen Warren
On 04/17/2012 11:10 PM, Hiroshi Doyu wrote: > On Mon, 16 Apr 2012 18:07:06 +0200 > Stephen Warren wrote: > >> On 04/16/2012 04:10 AM, Hiroshi Doyu wrote: >>> Stephen Warren wrote at Fri, 13 Apr 2012 21:33:47 +0200: On 04/13/2012 04:22 AM, Hiroshi Doyu wrote: > Add device tree support for

Re: [PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Stephen Warren
On 04/18/2012 04:19 AM, Hiroshi Doyu wrote: > Subject: [PATCH 1/1] dt: Add general DMA window parser > > This code was stolen from: > "arch/microblaze/kernel/prom_parse.c" > "arch/powerpc/kernel/prom_parse.c" > > Once "ibm," prefix is removed from dts file. This generic one could > r

[PATCHv9 05/10] ARM: dma-mapping: use asm-generic/dma-mapping-common.h

2012-04-18 Thread Marek Szyprowski
This patch modifies dma-mapping implementation on ARM architecture to use common dma_map_ops structure and asm-generic/dma-mapping-common.h helpers. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Tested-By: Subash Patel --- arch/arm/Kconfig |1 + arch/arm/include

[PATCHv9 06/10] ARM: dma-mapping: implement dma sg methods on top of any generic dma ops

2012-04-18 Thread Marek Szyprowski
This patch converts all dma_sg methods to be generic (independent of the current DMA mapping implementation for ARM architecture). All dma sg operations are now implemented on top of respective dma_map_page/dma_sync_single_for* operations from dma_map_ops structure. Before this patch there were cu

[PATCHv9 04/10] ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops

2012-04-18 Thread Marek Szyprowski
This patch removes the need for the offset parameter in dma bounce functions. This is required to let dma-mapping framework on ARM architecture to use common, generic dma_map_ops based dma-mapping helpers. Background and more detailed explaination: dma_*_range_* functions are available from the e

[PATCHv9 03/10] ARM: dma-mapping: introduce DMA_ERROR_CODE constant

2012-04-18 Thread Marek Szyprowski
Replace all uses of ~0 with DMA_ERROR_CODE, what should make the code easier to read. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Tested-By: Subash Patel --- arch/arm/common/dmabounce.c|6 +++--- arch/arm/include/asm/dma-mapping.h |4 +++- arch/arm/mm/dma-mapping.c

[PATCHv9 01/10] common: add dma_mmap_from_coherent() function

2012-04-18 Thread Marek Szyprowski
Add a common helper for dma-mapping core for mapping a coherent buffer to userspace. Reported-by: Subash Patel Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Tested-By: Subash Patel --- drivers/base/dma-coherent.c| 42 include/asm-generi

[PATCHv9 07/10] ARM: dma-mapping: move all dma bounce code to separate dma ops structure

2012-04-18 Thread Marek Szyprowski
This patch removes dma bounce hooks from the common dma mapping implementation on ARM architecture and creates a separate set of dma_map_ops for dma bounce devices. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Tested-By: Subash Patel --- arch/arm/common/dmabounce.c| 62 +++

[PATCHv9 10/10] ARM: dma-mapping: add support for IOMMU mapper

2012-04-18 Thread Marek Szyprowski
This patch add a complete implementation of DMA-mapping API for devices which have IOMMU support. This implementation tries to optimize dma address space usage by remapping all possible physical memory chunks into a single dma address space chunk. DMA address space is managed on top of the bitmap

[PATCHv9 09/10] ARM: dma-mapping: use alloc, mmap, free from dma_ops

2012-04-18 Thread Marek Szyprowski
This patch converts dma_alloc/free/mmap_{coherent,writecombine} functions to use generic alloc/free/mmap methods from dma_map_ops structure. A new DMA_ATTR_WRITE_COMBINE DMA attribute have been introduced to implement writecombine methods. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park

[PATCHv9 00/10] ARM: DMA-mapping framework redesign

2012-04-18 Thread Marek Szyprowski
Hello, This is a quick update on dma-mapping redesign patches for ARM. I did some minor fixes suggested by Arnd and extended commit messages for a few patches. Like the previous version, the patches have been rebased onto latest Linux v3.4-rc3 which comes with dma_map_ops related preparation chan

[PATCHv9 08/10] ARM: dma-mapping: remove redundant code and cleanup

2012-04-18 Thread Marek Szyprowski
This patch just performs a global cleanup in DMA mapping implementation for ARM architecture. Some of the tiny helper functions have been moved to the caller code, some have been merged together. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Acked-by: Arnd Bergmann Tested-By: Subash P

[PATCHv9 02/10] ARM: dma-mapping: use pr_* instread of printk

2012-04-18 Thread Marek Szyprowski
Replace all calls to printk with pr_* functions family. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Acked-by: Arnd Bergmann Tested-By: Subash Patel --- arch/arm/mm/dma-mapping.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/mm/dma

Re: [RFC PATCH 2/3] iommu: Create basic group infrastructure and update AMD-Vi & Intel VT-d

2012-04-18 Thread David Gibson
On Mon, Apr 02, 2012 at 03:14:46PM -0600, Alex Williamson wrote: > IOMMU groups define the minimum granularity of the IOMMU. We therefore > create groups using a dma_dev which is the effective requestor ID for > the entire group. Additional devices can be added to groups based on > system topolog

Re: [RFC PATCH 1/3] iommu: Introduce iommu_group

2012-04-18 Thread David Gibson
On Mon, Apr 02, 2012 at 03:14:40PM -0600, Alex Williamson wrote: > IOMMUs often do not have visibility of individual devices in the > system. Due to IOMMU design, bus topology, or device quirks, we > can often only identify groups of devices. Examples include > Intel VT-d & AMD-Vi which often hav

Re: [PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Hiroshi Doyu
From: Thierry Reding Subject: Re: [PATCH 1/1] dt: Add general DMA window parser Date: Wed, 18 Apr 2012 12:54:23 +0200 Message-ID: <20120418105423.ga5...@avionic-0098.mockup.avionic-design.de> > * PGP Signed by an unknown key > > * Hiroshi Doyu wrote: > > diff --git a/drivers/of/of_dma.c b/driver

Re: [PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Thierry Reding
* Hiroshi Doyu wrote: > diff --git a/drivers/of/of_dma.c b/drivers/of/of_dma.c > new file mode 100644 > index 000..45c9e88 > --- /dev/null > +++ b/drivers/of/of_dma.c > @@ -0,0 +1,35 @@ > +/* > + * Stolen from: > + * "arch/microblaze/kernel/prom_parse.c" > + * "arch/powerpc/kernel/prom_pars

Re: [PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Hiroshi Doyu
From: Thierry Reding Subject: Re: [PATCH 1/1] dt: Add general DMA window parser Date: Wed, 18 Apr 2012 12:26:29 +0200 Message-ID: <20120418102629.ga14...@avionic-0098.mockup.avionic-design.de> > * PGP Signed by an unknown key > > * Hiroshi Doyu wrote: > > + cells = prop ? *(__be32 *)prop : of_

Re: [PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Thierry Reding
* Hiroshi Doyu wrote: > + cells = prop ? *(__be32 *)prop : of_n_addr_cells(dn); I think this needs to be: cells = prop ? be32_to_cpup(prop) : of_n_addr_cells(dn); Only casting isn't enough, you need the bytes to be swapped. > + cells = prop ? *(__be32 *)prop : of_n_size_cells(dn

[PATCH 1/1] dt: Add general DMA window parser

2012-04-18 Thread Hiroshi Doyu
Hi, Try again with fixing Thierry's commnets, Thanks. >From 9a632c24949e46df197a216ca95f684edd1db693 Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Wed, 18 Apr 2012 12:09:03 +0300 Subject: [PATCH 1/1] dt: Add general DMA window parser This code was stolen from: "arch/microblaze/kerne

Re: [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU

2012-04-18 Thread Thierry Reding
* Hiroshi Doyu wrote: > diff --git a/drivers/of/of_dma.c b/drivers/of/of_dma.c > new file mode 100644 > index 000..1db1ccd > --- /dev/null > +++ b/drivers/of/of_dma.c > @@ -0,0 +1,35 @@ > +/* > + * Stealed from: "Stolen from" > + * "arch/microblaze/kernel/prom_parse.c" > + * "arch/powerpc

Re: [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU

2012-04-18 Thread Hiroshi Doyu
From: Arnd Bergmann Subject: Re: [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU Date: Wed, 18 Apr 2012 09:31:53 +0200 Message-ID: <201204180731.54064.a...@arndb.de> > On Wednesday 18 April 2012, Hiroshi Doyu wrote: > > If we can consider IOMMU as one of the implementation of DMA(D

Re: [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU

2012-04-18 Thread Arnd Bergmann
On Wednesday 18 April 2012, Hiroshi Doyu wrote: > If we can consider IOMMU as one of the implementation of DMA(Direct > Memory Access), the prefix "dma-(window)" may make sense here. Then, > we don't have to introduce a new concept "IO virtual address(iova)" in > addition to the existing "bus addre

Re: [PATCHv8 00/10] ARM: DMA-mapping framework redesign

2012-04-18 Thread Subash Patel
Hello Marek, I have tested below patch series for vanilla 3.4-rc2 (without videobuf2 support for dmabuf patches) with and without IOMMU support on origen board. These patches are good now. You can add: Tested-By: Subash Patel for whole series. Regards, Subash On 04/10/2012 04:34 PM, Marek