]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dma-buf: heaps: cma: Turn the heap into a module
authorMaxime Ripard <mripard@kernel.org>
Mon, 27 Apr 2026 10:04:58 +0000 (12:04 +0200)
committerSumit Semwal <sumit.semwal@linaro.org>
Thu, 21 May 2026 15:27:15 +0000 (20:57 +0530)
All the symbols used by the CMA heap are already exported, so turning it
into a module is straightforward. We only need to add the usual MODULE_*
macros, import the proper namespaces and change the Kconfig symbol to a
tristate.

This heap won't be able to unload though, since we're missing a lot of
infrastructure to make it safe.

Reviewed-by: T.J. Mercier <tjmercier@google.com>
Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patch.msgid.link/20260427-dma-buf-heaps-as-modules-v5-2-b6f5678feefc@kernel.org
drivers/dma-buf/heaps/Kconfig
drivers/dma-buf/heaps/cma_heap.c

index a5eef06c422644e8aadaf5aff2bd9a33c49c1ba3..aed0b9b4febf388376cfc41be9843980d010c4e8 100644 (file)
@@ -6,7 +6,7 @@ config DMABUF_HEAPS_SYSTEM
          is backed by pages from the buddy allocator. If in doubt, say Y.
 
 config DMABUF_HEAPS_CMA
-       bool "DMA-BUF CMA Heap"
+       tristate "DMA-BUF CMA Heap"
        depends on DMABUF_HEAPS && DMA_CMA
        help
          Choose this option to enable dma-buf CMA heap. This heap is backed
index a359aac4557990a4d5146031caae03d2374415a1..3fb4b946c91a6ee9aff1616034fc7d7922bb43c5 100644 (file)
@@ -420,3 +420,6 @@ static int __init add_cma_heaps(void)
 }
 module_init(add_cma_heaps);
 MODULE_DESCRIPTION("DMA-BUF CMA Heap");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("DMA_BUF");
+MODULE_IMPORT_NS("DMA_BUF_HEAP");