Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-20 Thread Lorenzo Nava
On Wed, May 20, 2015 at 6:20 PM, Russell King - ARM Linux wrote: > On Wed, May 20, 2015 at 02:57:36PM +0200, Lorenzo Nava wrote: >> so probably currently is impossible to allocate a contiguous cachable >> DMA memory. You can't use CMA, and the only functions which allow you >> to use it are not co

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-20 Thread Russell King - ARM Linux
On Wed, May 20, 2015 at 02:57:36PM +0200, Lorenzo Nava wrote: > so probably currently is impossible to allocate a contiguous cachable > DMA memory. You can't use CMA, and the only functions which allow you > to use it are not compatible with sync functions. > Do you think the problem is the CMA des

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-20 Thread Lorenzo Nava
On Wed, May 20, 2015 at 12:34 AM, Russell King - ARM Linux wrote: > On Wed, May 20, 2015 at 12:14:48AM +0200, Arnd Bergmann wrote: >> With that memory, you should be able to use the normal streaming >> API (dma_sync_single_for_*). > > Wrong, as I've pointed out previously. The only memory which y

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Russell King - ARM Linux
On Wed, May 20, 2015 at 12:14:48AM +0200, Arnd Bergmann wrote: > With that memory, you should be able to use the normal streaming > API (dma_sync_single_for_*). Wrong, as I've pointed out previously. The only memory which you're allowed to sync is with memory which has been mapped with a dma_map_

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Lorenzo Nava
On Wed, May 20, 2015 at 12:14 AM, Arnd Bergmann wrote: > On Wednesday 20 May 2015 00:05:54 Lorenzo Nava wrote: >> >> On Tue, May 19, 2015 at 6:34 PM, Catalin Marinas >> wrote: >> > On Mon, May 18, 2015 at 10:56:06PM +0200, Lorenzo Nava wrote: >> >> it's been a while since I've started working wit

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Arnd Bergmann
On Wednesday 20 May 2015 00:05:54 Lorenzo Nava wrote: > > On Tue, May 19, 2015 at 6:34 PM, Catalin Marinas > wrote: > > On Mon, May 18, 2015 at 10:56:06PM +0200, Lorenzo Nava wrote: > >> it's been a while since I've started working with DMA on ARM processor > >> for a smart camera project. Typica

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Russell King - ARM Linux
On Wed, May 20, 2015 at 12:05:54AM +0200, Lorenzo Nava wrote: > Maybe my interpretation of dma_alloc_coherent() is not correct, and > the coherency can be managed using the dma_sync_single_for_* functions > and it doesn't require hardware mechanism. dma_sync_single_for_* are only for use with the

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Lorenzo Nava
On Tue, May 19, 2015 at 6:34 PM, Catalin Marinas wrote: > On Mon, May 18, 2015 at 10:56:06PM +0200, Lorenzo Nava wrote: >> it's been a while since I've started working with DMA on ARM processor >> for a smart camera project. Typically the requirements is to have a >> large memory area which can be

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Lorenzo Nava
Thanks for the answer. I do agree with you on that: I'll take a look at arm64 code and I'll be glad to contribute with patches as soon as possible. Anyway I'd like to focus on a different aspect: I think that this solution can manage cache coherent DMA, so devices which guarantees the coherency us

Re: [RFC] arm: DMA-API contiguous cacheable memory

2015-05-19 Thread Catalin Marinas
On Mon, May 18, 2015 at 10:56:06PM +0200, Lorenzo Nava wrote: > it's been a while since I've started working with DMA on ARM processor > for a smart camera project. Typically the requirements is to have a > large memory area which can be accessed by both DMA and user. I've > already noticed that ma