Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dma: contiguous: Register reusable CMA regions at boot

In order to create a CMA dma-buf heap instance for each CMA heap region
in the system, we need to collect all of them during boot.

They are created from two main sources: the reserved-memory regions in
the device tree, and the default CMA region created from the
configuration or command line parameters, if no default region is
provided in the device tree.

Let's collect all the device-tree defined CMA regions flagged as
reusable.

Reviewed-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://lore.kernel.org/r/20251013-dma-buf-ecc-heap-v8-3-04ce150ea3d9@kernel.org

authored by

Maxime Ripard and committed by
Sumit Semwal
84a59306 8b5690d5

+5
+5
kernel/dma/contiguous.c
··· 42 42 #include <linux/memblock.h> 43 43 #include <linux/err.h> 44 44 #include <linux/sizes.h> 45 + #include <linux/dma-buf/heaps/cma.h> 45 46 #include <linux/dma-map-ops.h> 46 47 #include <linux/cma.h> 47 48 #include <linux/nospec.h> ··· 493 492 494 493 pr_info("Reserved memory: created CMA memory pool at %pa, size %ld MiB\n", 495 494 &rmem->base, (unsigned long)rmem->size / SZ_1M); 495 + 496 + err = dma_heap_cma_register_heap(cma); 497 + if (err) 498 + pr_warn("Couldn't register CMA heap."); 496 499 497 500 return 0; 498 501 }