]> Gentwo Git Trees - linux/.git/commit
dma-buf: heaps: cma: Register list of CMA regions at boot
authorMaxime Ripard <mripard@kernel.org>
Mon, 13 Oct 2025 08:35:17 +0000 (10:35 +0200)
committerSumit Semwal <sumit.semwal@linaro.org>
Sat, 18 Oct 2025 16:01:21 +0000 (21:31 +0530)
commit8b5690d5c942a80535f095c8965028262d4ab0f7
tree037addc23b4758dd9255b01f3cd255971472216c
parent2034134de658f2f5a433d1e43b28e07d021a2cd1
dma-buf: heaps: cma: Register list of CMA regions at boot

In order to create a CMA heap instance for each CMA region found in the
system, we need to register each of these instances.

While it would appear trivial, the CMA regions are created super early
in the kernel boot process, before most of the subsystems are
initialized. Thus, we can't just create an exported function to create a
heap from the CMA region being initialized.

What we can do however is create a two-step process, where we collect
all the CMA regions into an array early on, and then when we initialize
the heaps we iterate over that array and create the heaps from the CMA
regions we collected.

Reviewed-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://lore.kernel.org/r/20251013-dma-buf-ecc-heap-v8-2-04ce150ea3d9@kernel.org
MAINTAINERS
drivers/dma-buf/heaps/cma_heap.c
include/linux/dma-buf/heaps/cma.h [new file with mode: 0644]