Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-17 Thread Marek Szyprowski
Hello, I'm really sorry do late joining this discussion, but I was terribly busy with other things. On 2015-10-30 02:17, Daniel Kurtz wrote: +linux-media & VIDEOBUF2 FRAMEWORK maintainers since this is about the v4l2-contig's usage of the DMA API. Hi Robin, On Tue, Oct 27, 2015 at 12:55

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-09 Thread Robin Murphy
On 04/11/15 05:12, Tomasz Figa wrote: On Wed, Nov 4, 2015 at 2:41 AM, Robin Murphy wrote: Hi Tomasz, On 02/11/15 13:43, Tomasz Figa wrote: I'd like to know what is the boundary mask and what hardware imposes requirements like this. The cost here is not only

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Russell King - ARM Linux
On Wed, Nov 04, 2015 at 02:15:41PM +0900, Tomasz Figa wrote: > On Wed, Nov 4, 2015 at 3:40 AM, Russell King - ARM Linux > wrote: > > On Tue, Nov 03, 2015 at 05:41:24PM +, Robin Murphy wrote: > >> Hi Tomasz, > >> > >> On 02/11/15 13:43, Tomasz Figa wrote: > >> >Agreed.

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Tomasz Figa
On Wed, Nov 4, 2015 at 6:27 PM, Russell King - ARM Linux wrote: > On Wed, Nov 04, 2015 at 02:12:03PM +0900, Tomasz Figa wrote: >> My understanding of a scatterlist was that it represents a buffer as a >> whole, by joining together its physically discontinuous segments. > >

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-04 Thread Russell King - ARM Linux
On Wed, Nov 04, 2015 at 06:48:50PM +0900, Tomasz Figa wrote: > There is no requirement, but shouldn't it be desired for the mapping > code to map them as such? Otherwise, how could the IOMMU use case you > described above (address translator for devices which don't have the > capability to address

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-03 Thread Robin Murphy
Hi Tomasz, On 02/11/15 13:43, Tomasz Figa wrote: I'd like to know what is the boundary mask and what hardware imposes requirements like this. The cost here is not only over-allocating a little, but making many, many buffers contiguously mappable on the CPU, unmappable contiguously in IOMMU,

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-03 Thread Russell King - ARM Linux
On Tue, Nov 03, 2015 at 05:41:24PM +, Robin Murphy wrote: > Hi Tomasz, > > On 02/11/15 13:43, Tomasz Figa wrote: > >Agreed. The dma_map_*() API is not guaranteed to return a single > >contiguous part of virtual address space for any given SG list. > >However it was understood to be able to

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-03 Thread Tomasz Figa
On Wed, Nov 4, 2015 at 2:41 AM, Robin Murphy wrote: > Hi Tomasz, > > On 02/11/15 13:43, Tomasz Figa wrote: >> >> I'd like to know what is the boundary mask and what hardware imposes >> requirements like this. The cost here is not only over-allocating a >> little, but making

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-03 Thread Tomasz Figa
On Wed, Nov 4, 2015 at 3:40 AM, Russell King - ARM Linux wrote: > On Tue, Nov 03, 2015 at 05:41:24PM +, Robin Murphy wrote: >> Hi Tomasz, >> >> On 02/11/15 13:43, Tomasz Figa wrote: >> >Agreed. The dma_map_*() API is not guaranteed to return a single >> >contiguous

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-02 Thread Tomasz Figa
On Mon, Nov 2, 2015 at 10:11 PM, Daniel Kurtz wrote: > > +Tomasz, so he can reply to the thread > +Marek and Russell as recommended by Tomasz > > On Oct 30, 2015 22:27, "Robin Murphy" wrote: > > > > Hi Dan, > > > > On 30/10/15 01:17, Daniel Kurtz

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-11-02 Thread Daniel Kurtz
+Tomasz, so he can reply to the thread +Marek and Russell as recommended by Tomasz On Oct 30, 2015 22:27, "Robin Murphy" wrote: > > Hi Dan, > > On 30/10/15 01:17, Daniel Kurtz wrote: >> >> +linux-media & VIDEOBUF2 FRAMEWORK maintainers since this is about the >>

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-30 Thread Joerg Roedel
On Fri, Oct 30, 2015 at 09:17:52AM +0800, Daniel Kurtz wrote: > Hmm, I thought the DMA API maps a (possibly) non-contiguous set of > memory pages into a contiguous block in device memory address space. > This would allow passing a dma mapped buffer to device dma using just > a device address and

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-30 Thread Robin Murphy
Hi Dan, On 30/10/15 01:17, Daniel Kurtz wrote: +linux-media & VIDEOBUF2 FRAMEWORK maintainers since this is about the v4l2-contig's usage of the DMA API. Hi Robin, On Tue, Oct 27, 2015 at 12:55 AM, Robin Murphy wrote: On 26/10/15 13:44, Yong Wu wrote: On Thu,

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-30 Thread Mark Hounschell
On 10/30/2015 10:09 AM, Joerg Roedel wrote: On Fri, Oct 30, 2015 at 09:17:52AM +0800, Daniel Kurtz wrote: Hmm, I thought the DMA API maps a (possibly) non-contiguous set of memory pages into a contiguous block in device memory address space. This would allow passing a dma mapped buffer to

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-29 Thread Daniel Kurtz
+linux-media & VIDEOBUF2 FRAMEWORK maintainers since this is about the v4l2-contig's usage of the DMA API. Hi Robin, On Tue, Oct 27, 2015 at 12:55 AM, Robin Murphy wrote: > On 26/10/15 13:44, Yong Wu wrote: >> >> On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: >>

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-26 Thread Yong Wu
On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: [...] > +/* > + * The DMA API client is passing in a scatterlist which could describe > + * any old buffer layout, but the IOMMU API requires everything to be > + * aligned to IOMMU pages. Hence the need for this complicated bit of > + *

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-26 Thread Robin Murphy
On 26/10/15 13:44, Yong Wu wrote: On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: [...] +/* + * The DMA API client is passing in a scatterlist which could describe + * any old buffer layout, but the IOMMU API requires everything to be + * aligned to IOMMU pages. Hence the need for this

[PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-01 Thread Robin Murphy
Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting for IOMMU-backed dma-mapping. Since associating an IOVA allocator with an IOMMU domain is a fairly common need, rather than