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

Marek Vasut marex at denx.de
Sat Oct 10 20:19:40 CEST 2015


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 modify external variables in case of failure, no?
> 
> The *handle return a DMA address, and the function itself return a
> virtual address. Both of them should be set to NULL in case of failure.

So you depend on this property of memalign(), ok, I see. Thanks for clarifying!

> 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 ?

Best regards,
Marek Vasut


More information about the U-Boot mailing list