Skip to contentSkip to conversation

dma-buf: move dma-buf symbols into the DMA_BUF module namespace.

PATCH In review Kolanupaka Naveena 2 participants 3 messages Feb 2, 2024 – Feb 5, 2024 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

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

From: Sagar Chormale <[email protected]>

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

-------------------------------------------------------------------------------
Backports

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

---
 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +7 -0
index d7e4ef3fa589d..6d14315dfce40 100644
@@ -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;
#2 lore raw

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c line 14

Quoted 3 lines · Kolanupaka Naveena
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3 -0
+#ifdef BPM_MODULE_IMPORT_NS_SUPPORT
+#include <linux/module.h>
+#endif

No #ifdef in .c files please, this should not be an issue, just include the .h file.

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c line 31

Quoted 10 lines

#include <drm/intel_iaf_platform.h>

#include "gem/i915_gem_dmabuf.h"

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3 -0
@@ -23,6 +26,10 @@
 #include "i915_trace.h"
 #include "intel_iaf.h"
 
+#ifdef BPM_MODULE_IMPORT_NS_SUPPORT
+MODULE_IMPORT_NS(DMA_BUF);
+#endif

Why is a #ifdef needed here? If this isn't built as a module, it's not an issue, please just make it simpler.

But really, why is this a #define at all in the first place?

thanks,

greg k-h

#3 lore raw

Hi Greg,

Thanks for your inputs and patience in reviewing the patch.
By mistakenly this internal patch has been sent for review as the reference commit ID is from opensource, email has been sent to those who are all involved in that commit. Please ignore this patch as it is for internal usage.

Thanks and Regards

Kolanupaka Naveena
Graphics Software Engineer | GSE OSGC
M +918374415216
Intel Corporation | intel.com

Quoted 44 lines

-----Original Message-----
From: Greg Kroah-Hartman <[email protected]>
Sent: Friday, February 2, 2024 9:46 PM
To: Kolanupaka Naveena <[email protected]>
Cc: [email protected]; Wilson, Chris P <[email protected]>; Siddiqui, Ayaz A <[email protected]>; Muqthyar Ahmed, Syed Abdul <[email protected]>; Sagar Chormale <[email protected]>; Pan, Xinhui <[email protected]>; David Airlie <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; Mauro Carvalho Chehab <[email protected]>; [email protected]; Daniel Vetter <[email protected]>; Christian König <[email protected]>; Arnd Bergmann <[email protected]>; Sumit Semwal <[email protected]>; Alex Deucher <[email protected]>
Subject: Re: [PATCH 40/46] dma-buf: move dma-buf symbols into the DMA_BUF module namespace.

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c line 14

Quoted 3 lines · Kolanupaka Naveena
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3 -0
+#ifdef BPM_MODULE_IMPORT_NS_SUPPORT
+#include <linux/module.h>
+#endif

No #ifdef in .c files please, this should not be an issue, just include the .h file.

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c line 31

Quoted 10 lines

#include <drm/intel_iaf_platform.h>

#include "gem/i915_gem_dmabuf.h"

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3 -0
@@ -23,6 +26,10 @@
 #include "i915_trace.h"
 #include "intel_iaf.h"
 
+#ifdef BPM_MODULE_IMPORT_NS_SUPPORT
+MODULE_IMPORT_NS(DMA_BUF);
+#endif

Why is a #ifdef needed here? If this isn't built as a module, it's not an issue, please just make it simpler.

But really, why is this a #define at all in the first place?

thanks,

greg k-h