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

2015-10-09 Thread Thomas Chou
Hi Marek, I look into the code again. I think it is the memalign() that might fail due to out of memory. While the ioremap() of nios2 won't fail. So I added a check on memalign() return. Please see v3. Best regards, Thomas ___ U-Boot mailing list U-

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

2015-10-09 Thread Thomas Chou
Hi Marek, On 10/09/2015 05:43 AM, Marek Vasut wrote: I'd suggest that you do this: void *reg; unsigned long *h = memalign(...); flush_dcache_range(); reg = ioremap(); if (!reg) fail here *handle = h; // modify handle after we know ioremap succeeded. return reg; Thanks a lot for your su

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

2015-10-08 Thread Marek Vasut
On Tuesday, October 06, 2015 at 08:49:49 AM, Thomas Chou wrote: > Convert dma_alloc_coherent to use memalign. > > Signed-off-by: Thomas Chou > --- > v2 > use memalign. > > arch/nios2/include/asm/dma-mapping.h | 21 - > 1 file changed, 8 insertions(+), 13 deletions(-) > >

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

2015-10-05 Thread Thomas Chou
Convert dma_alloc_coherent to use memalign. Signed-off-by: Thomas Chou --- v2 use memalign. arch/nios2/include/asm/dma-mapping.h | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mappin