[PATCH 40/46] dma-buf: move dma-buf symbols into the DMA_BUF module namespace.

Kolanupaka Naveena kolanupaka.naveena at intel.com
Fri Feb 2 08:31:47 UTC 2024


From: Sagar Chormale <sagar.chormale at intel.com>

In order to better track where in the kernel the dma-buf code is used,
put the symbols in the namespace DMA_BUF and modify all users of the
symbols to properly import the namespace to not break the build at the
same time.

Now the output of modinfo shows the use of these symbols, making it
easier to watch for users over time.

$ modinfo drivers/misc/fastrpc.ko | grep import
import_ns:      DMA_BUF

Cc: "Pan, Xinhui" <Xinhui.Pan at amd.com>
Cc: David Airlie <airlied at linux.ie>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Maxime Ripard <mripard at kernel.org>
Cc: Thomas Zimmermann <tzimmermann at suse.de>
Cc: Mauro Carvalho Chehab <mchehab at kernel.org>
Cc: dri-devel at lists.freedesktop.org
Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Acked-by: Christian König <christian.koenig at amd.com>
Acked-by: Arnd Bergmann <arnd at arndb.de>
Acked-by: Sumit Semwal <sumit.semwal at linaro.org>
Acked-by: Alex Deucher <alexander.deucher at amd.com>
Link: https://lore.kernel.org/r/20211010124628.17691-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
-------------------------------------------------------------------------------
Backports

'commit 16b0314aa746 ("dma-buf: move dma-buf symbols into the DMA_BUF
module namespace.")'

Signed-off-by: Sagar Chormale <sagar.chormale at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
index d7e4ef3fa589d..6d14315dfce40 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
@@ -9,6 +9,9 @@
 #include <linux/list.h>
 #include <linux/pci-p2pdma.h>
 #include <linux/scatterlist.h>
+#ifdef BPM_MODULE_IMPORT_NS_SUPPORT
+#include <linux/module.h>
+#endif
 #include <drm/intel_iaf_platform.h>
 
 #include "gem/i915_gem_dmabuf.h"
@@ -23,6 +26,10 @@
 #include "i915_trace.h"
 #include "intel_iaf.h"
 
+#ifdef BPM_MODULE_IMPORT_NS_SUPPORT
+MODULE_IMPORT_NS(DMA_BUF);
+#endif
+
 I915_SELFTEST_DECLARE(static bool force_different_devices;)
 
 static const struct drm_i915_gem_object_ops i915_gem_object_dmabuf_ops;


More information about the dri-devel mailing list