Re: [U-Boot] [PATCH v3] nios2: convert dma_alloc_coherent to use memalign

2015-10-11 Thread Marek Vasut
On Sunday, October 11, 2015 at 03:48:58 AM, Thomas Chou wrote: > Hi Marek, Hi, > On 10/11/2015 02:19 AM, Marek Vasut wrote: > > It might be wrong to keep DMA address looks alive but actually dead. > > > > I don't quite understand this sentence, can you please rephrase it ? > > Sorry. I meant th

Re: [U-Boot] [PATCH v3] nios2: convert dma_alloc_coherent to use memalign

2015-10-10 Thread Thomas Chou
Hi Marek, On 10/11/2015 02:19 AM, Marek Vasut wrote: It might be wrong to keep DMA address looks alive but actually dead. I don't quite understand this sentence, can you please rephrase it ? Sorry. I meant the *handle, which is the DMA address, should be invalidated to NULL when the allocati

Re: [U-Boot] [PATCH v3] nios2: convert dma_alloc_coherent to use memalign

2015-10-10 Thread Marek Vasut
On Saturday, October 10, 2015 at 07:33:06 AM, Thomas Chou wrote: > Hi Marek, Hi! > On 10/09/2015 10:49 PM, Marek Vasut wrote: > >> + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); > > > > This still modifies the handle in both cases (failure and success). > > We really want to modif

Re: [U-Boot] [PATCH v3] nios2: convert dma_alloc_coherent to use memalign

2015-10-09 Thread Thomas Chou
Hi Marek, On 10/09/2015 10:49 PM, Marek Vasut wrote: + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); This still modifies the handle in both cases (failure and success). We really want to modify external variables in case of failure, no? The *handle return a DMA address, an

Re: [U-Boot] [PATCH v3] nios2: convert dma_alloc_coherent to use memalign

2015-10-09 Thread Marek Vasut
On Friday, October 09, 2015 at 01:31:02 PM, Thomas Chou wrote: > Convert dma_alloc_coherent to use memalign. > > Signed-off-by: Thomas Chou > --- > v2 > use memalign. > v3 > check memalign() return for out of memory. > > arch/nios2/include/asm/dma-mapping.h | 23 ++- > 1

[U-Boot] [PATCH v3] nios2: convert dma_alloc_coherent to use memalign

2015-10-09 Thread Thomas Chou
Convert dma_alloc_coherent to use memalign. Signed-off-by: Thomas Chou --- v2 use memalign. v3 check memalign() return for out of memory. arch/nios2/include/asm/dma-mapping.h | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/nios2/include/asm