diff options
| author | Maxime Ripard <mripard@kernel.org> | 2025-10-13 10:35:19 +0200 |
|---|---|---|
| committer | Sumit Semwal <sumit.semwal@linaro.org> | 2025-10-18 21:31:21 +0530 |
| commit | 8f1fc1bf1a3d5a61f7465435591a439c1e4671f2 (patch) | |
| tree | 522cbbc4c877b0f0c72d18ddd6f00bfa3748bca1 | |
| parent | 84a593066a85e6fdfb7b71f74400ed6bb5e0c3fa (diff) | |
dma: contiguous: Reserve default CMA heap
The CMA code, in addition to the reserved-memory regions in the device
tree, will also register a default CMA region if the device tree doesn't
provide any, with its size and position coming from either the kernel
command-line or configuration.
Let's register that one for use to create a heap for it.
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-4-04ce150ea3d9@kernel.org
| -rw-r--r-- | kernel/dma/contiguous.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index d67e95094749..d8fd6f779f79 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -242,6 +242,8 @@ void __init dma_contiguous_reserve(phys_addr_t limit) } if (selected_size && !dma_contiguous_default_area) { + int ret; + pr_debug("%s: reserving %ld MiB for global area\n", __func__, (unsigned long)selected_size / SZ_1M); @@ -249,6 +251,10 @@ void __init dma_contiguous_reserve(phys_addr_t limit) selected_limit, &dma_contiguous_default_area, fixed); + + ret = dma_heap_cma_register_heap(dma_contiguous_default_area); + if (ret) + pr_warn("Couldn't register default CMA heap."); } } |
