Re: [PATCH v2] staging: ion: Add a default struct device for cma heap

From: Michal Nazarewicz
Date: Sat Aug 08 2015 - 06:40:03 EST

On Fri, Aug 07 2015, Feng Tang wrote:
> For ion cma heap, the buffer allocation func ion_cma_allocate() will
> call dma_alloc_coherent(dev, ...). And dma_alloc_coherent() is
> implemented by each architeture(arm/m68k/x86 etc), and many Arch's
> implementation doesn't use cma, but use alloc_pages() like APIs.

So what youâre saying is that âION CMA heapâ is a misnomer since it has
to do with CMA only if given architecture implements dma_alloc_coherent
using CMA. It should rather be called âION DMA coherent heapâ.

This leads to realisation that the code should be oblivious to CMA areas
and never operate on them directly (e.g. never accept struct cma * or
use dev_set_cma_area). In the current form, if architecture does not
use CMA, the whole dev_set_cma_area shenanigans are pointless.

Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, MichaÅ âmina86â Nazarewicz (o o)
ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>--ooO--(_)--Ooo--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at