Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps

From: Christoph Hellwig
Date: Thu Jul 25 2019 - 14:06:11 EST


On Wed, Jul 24, 2019 at 11:46:01AM -0400, Andrew F. Davis wrote:
> https://patchwork.kernel.org/patch/10863957/
>
> It's actually a more simple heap type IMHO, but the logic inside is
> incompatible with the system/CMA heaps, if you move any of their code
> into the core framework then this heap stops working. Leading to out of
> tree hacks on the core to get it back functional. I see the same for the
> "complex" heaps with ION.

Well, this mostly is just another allocator (gen_pool). And given that
the whole dma-buf infrastucture assumes things are backed by pages we
really shouldn't need much more than an alloc and a free callback (and
maybe the pgprot to map it) and handle the rest in common code.