Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-12 Thread Marek Szyprowski
Hello Robin, On 2015-02-06 15:55, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Signed-off-by: Robin Murphy --- arch/arm64/include/asm/device.h | 3 + arch/arm64/include/asm/d

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-10 Thread Robin Murphy
On 09/03/15 20:09, Robin Murphy wrote: [...] I think ideally you'd call dma_map_page when you first create the page table, dma_sync_single_for_device on any update, and dma_unmap_page when you tear it down, and you'd also use the appropriate DMA addresses everywhere instead of physical addresses.

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-09 Thread Robin Murphy
Hi Russell, On 09/03/15 17:59, Russell King - ARM Linux wrote: [...] For a noncoherent device, dma_map_single() will end up calling __dma_map_area() with the page offset and size of the original request, so the updated part gets flushed by VA, and the rest of the page isn't touched if it doesn'

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-09 Thread Russell King - ARM Linux
On Thu, Mar 05, 2015 at 11:16:28AM +, Robin Murphy wrote: > Hi Laura, > > On 05/03/15 00:19, Laura Abbott wrote: > [...] > >>Consider that the IOMMU's page table walker is a DMA master in its own > >right, and that is the device you're mapping the page tables for. > >Therefore your IOMMU drive

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-05 Thread Robin Murphy
Hi Laura, On 05/03/15 00:19, Laura Abbott wrote: [...] Consider that the IOMMU's page table walker is a DMA master in its own right, and that is the device you're mapping the page tables for. Therefore your IOMMU driver needs to have access to the struct device of the IOMMU itself to use for th

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-04 Thread Laura Abbott
On 3/3/2015 4:15 AM, Robin Murphy wrote: On 03/03/15 03:38, Yong Wu wrote: On Mon, 2015-02-16 at 20:04 +, Robin Murphy wrote: 2)int (*domain_init)(struct iommu_domain *domain); About this function, it will alloc pagetable for the iommu domain. And We expect the pagetable me

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-03 Thread Robin Murphy
On 03/03/15 03:38, Yong Wu wrote: On Mon, 2015-02-16 at 20:04 +, Robin Murphy wrote: 2)int (*domain_init)(struct iommu_domain *domain); About this function, it will alloc pagetable for the iommu domain. And We expect the pagetable memory is uncacheable, so try to call "dma_a

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-03-02 Thread Yong Wu
On Mon, 2015-02-16 at 20:04 +, Robin Murphy wrote: > > 2)int (*domain_init)(struct iommu_domain *domain); > > About this function, it will alloc pagetable for the iommu > > domain. And We expect the pagetable memory is uncacheable, so try to > > call "dma_alloc_coherent", unfortu

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-16 Thread Robin Murphy
On 14/02/15 08:03, Yong Wu wrote: On Tue, 2015-02-10 at 12:07 +, Robin Murphy wrote: On 10/02/15 04:39, Yingjoe Chen wrote: On Fri, 2015-02-06 at 14:55 +, Robin Murphy wrote <...> diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 6932bb5..c

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-14 Thread Yong Wu
On Tue, 2015-02-10 at 12:07 +, Robin Murphy wrote: > On 10/02/15 04:39, Yingjoe Chen wrote: > > On Fri, 2015-02-06 at 14:55 +, Robin Murphy wrote > > <...> > >> diff --git a/arch/arm64/include/asm/dma-mapping.h > >> b/arch/arm64/include/asm/dma-mapping.h > >> index 6932bb5..c1b271f 100644

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-10 Thread Robin Murphy
On 09/02/15 06:02, Will Deacon wrote: On Fri, Feb 06, 2015 at 02:55:14PM +, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Is anybody looking at porting arch/arm/ over to this? If

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-10 Thread Robin Murphy
On 10/02/15 04:39, Yingjoe Chen wrote: On Fri, 2015-02-06 at 14:55 +, Robin Murphy wrote <...> diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 6932bb5..c1b271f 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-m

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-09 Thread Yingjoe Chen
On Fri, 2015-02-06 at 14:55 +, Robin Murphy wrote <...> > diff --git a/arch/arm64/include/asm/dma-mapping.h > b/arch/arm64/include/asm/dma-mapping.h > index 6932bb5..c1b271f 100644 > --- a/arch/arm64/include/asm/dma-mapping.h > +++ b/arch/arm64/include/asm/dma-mapping.h > @@ -62,13 +62,30 @@ s

Re: [RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-08 Thread Will Deacon
On Fri, Feb 06, 2015 at 02:55:14PM +, Robin Murphy wrote: > Taking some inspiration from the arch/arm code, implement the > arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Is anybody looking at porting arch/arm/ over to this? > Signed-off-by: Robin Murphy > --- > ar

[RFC PATCH v2 2/3] arm64: add IOMMU dma_ops

2015-02-06 Thread Robin Murphy
Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Signed-off-by: Robin Murphy --- arch/arm64/include/asm/device.h | 3 + arch/arm64/include/asm/dma-mapping.h | 17 ++ arch/arm64/mm/dma-mapping.c