Re: [PATCH] kernel/dma: export dma_alloc_from_contiguous to modules
From: Christoph Hellwig
Date: Thu Jul 11 2019 - 06:03:38 EST
On Thu, Jul 11, 2019 at 09:50:58AM +0100, Robin Murphy wrote:
> On 11/07/2019 06:33, miles.chen@xxxxxxxxxxxx wrote:
>> From: Miles Chen <miles.chen@xxxxxxxxxxxx>
>> This change exports dma_alloc_from_contiguous and
>> dma_release_from_contiguous to modules.
>> Currently, we can add a reserve a memory node in dts files, make
>> it a CMA memory by setting compatible = "shared-dma-pool",
>> and setup the dev->cma_area by using of_reserved_mem_device_init_by_idx().
>> Export dma_alloc_from_contiguous and dma_release_from_contiguous, so we
>> can allocate/free from/to dev->cma_area in kernel modules.
> As far as I understand, this was never intended for drivers to call
> directly. If a device has its own private CMA area, then regular
> dma_alloc_attrs() should allocate from that automatically; if that's not
> happening already, then there's a bug somewhere.