dma-buf: move dma-buf symbols into the DMA_BUF module namespace
Subsystems (23)
Greg Kroah-Hartman
maintainerPATCH 1/1 dma-buf: move dma-buf symbols into the DMA_BUF module namespace
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
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
Comments?
drivers/dma-buf/dma-buf.c | 34 +++++++++---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++ drivers/gpu/drm/drm_prime.c | 3 ++ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 3 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++ drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++ drivers/gpu/drm/tegra/gem.c | 3 ++ drivers/gpu/drm/vmwgfx/ttm_object.c | 3 ++ drivers/infiniband/core/umem_dmabuf.c | 3 ++ .../media/common/videobuf2/videobuf2-core.c | 1 + .../common/videobuf2/videobuf2-dma-contig.c | 1 + .../media/common/videobuf2/videobuf2-dma-sg.c | 1 + .../common/videobuf2/videobuf2-vmalloc.c | 1 + drivers/misc/fastrpc.c | 1 + .../staging/media/tegra-vde/dmabuf-cache.c | 3 ++ drivers/tee/tee_shm.c | 3 ++ drivers/virtio/virtio_dma_buf.c | 1 + drivers/xen/gntdev-dmabuf.c | 3 ++ samples/vfio-mdev/mbochs.c | 1 + 20 files changed, 60 insertions(+), 17 deletions(-)
drivers/dma-buf/dma-buf.c +17 -17
@@ -610,7 +610,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)module_put (exp_info->owner);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_export); +EXPORT_SYMBOL_NS_GPL (dma_buf_export,DMA_BUF );/** * dma_buf_fd - returns a file descriptor for the given struct dma_buf
@@ -634,7 +634,7 @@ int dma_buf_fd(struct dma_buf *dmabuf, int flags)return fd; } -EXPORT_SYMBOL_GPL (dma_buf_fd); +EXPORT_SYMBOL_NS_GPL (dma_buf_fd,DMA_BUF );/** * dma_buf_get - returns the struct dma_buf related to an fd
@@ -660,7 +660,7 @@ struct dma_buf *dma_buf_get(int fd)return file->private_data; } -EXPORT_SYMBOL_GPL (dma_buf_get); +EXPORT_SYMBOL_NS_GPL (dma_buf_get,DMA_BUF );/** * dma_buf_put - decreases refcount of the buffer
@@ -679,7 +679,7 @@ void dma_buf_put(struct dma_buf *dmabuf)fput (dmabuf->file); } -EXPORT_SYMBOL_GPL (dma_buf_put); +EXPORT_SYMBOL_NS_GPL (dma_buf_put,DMA_BUF );static void mangle_sg_table (struct sg_table *sg_table) {
@@ -810,7 +810,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,dma_buf_detach (dmabuf, attach);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_dynamic_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_dynamic_attach,DMA_BUF );/** * dma_buf_attach - Wrapper for dma_buf_dynamic_attach
@@ -825,7 +825,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, {return dma_buf_dynamic_attach (dmabuf, dev,NULL ,NULL ); } -EXPORT_SYMBOL_GPL (dma_buf_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_attach,DMA_BUF ); static void __unmap_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sg_table,
@@ -871,7 +871,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)kfree (attach); } -EXPORT_SYMBOL_GPL (dma_buf_detach); +EXPORT_SYMBOL_NS_GPL (dma_buf_detach,DMA_BUF );/** * dma_buf_pin - Lock down the DMA-buf
@@ -901,7 +901,7 @@ int dma_buf_pin(struct dma_buf_attachment *attach)return ret; } -EXPORT_SYMBOL_GPL (dma_buf_pin); +EXPORT_SYMBOL_NS_GPL (dma_buf_pin,DMA_BUF );/** * dma_buf_unpin - Unpin a DMA-buf
@@ -922,7 +922,7 @@ void dma_buf_unpin(struct dma_buf_attachment *attach)if (dmabuf->ops->unpin) dmabuf->ops->unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unpin); +EXPORT_SYMBOL_NS_GPL (dma_buf_unpin,DMA_BUF );/** * dma_buf_map_attachment - Returns the scatterlist table of the attachment;
@@ -1012,7 +1012,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,#endif /* CONFIG_DMA_API_DEBUG */ return sg_table; } -EXPORT_SYMBOL_GPL (dma_buf_map_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF );/** * dma_buf_unmap_attachment - unmaps and decreases usecount of the buffer;might
@@ -1048,7 +1048,7 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, !IS_ENABLED(CONFIG_DMABUF_MOVE_NOTIFY))dma_buf_unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unmap_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF );/** * dma_buf_move_notify - notify attachments that DMA-buf is moving
@@ -1068,7 +1068,7 @@ void dma_buf_move_notify(struct dma_buf *dmabuf)if (attach->importer_ops) attach->importer_ops->move_notify (attach); } -EXPORT_SYMBOL_GPL (dma_buf_move_notify); +EXPORT_SYMBOL_NS_GPL (dma_buf_move_notify,DMA_BUF );/** * DOC: cpu access
@@ -1212,7 +1212,7 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_begin_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_begin_cpu_access,DMA_BUF );/** * dma_buf_end_cpu_access - Must be called after accessing a dma_buf from the
@@ -1240,7 +1240,7 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_end_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_end_cpu_access,DMA_BUF );/**
@@ -1282,7 +1282,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,return dmabuf->ops->mmap (dmabuf, vma); } -EXPORT_SYMBOL_GPL (dma_buf_mmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );/** * dma_buf_vmap - Create virtual mapping for the buffer object into kernel
@@ -1336,7 +1336,7 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)mutex_unlock (&dmabuf->lock);return ret; } -EXPORT_SYMBOL_GPL (dma_buf_vmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap.
@@ -1360,7 +1360,7 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) }mutex_unlock (&dmabuf->lock); } -EXPORT_SYMBOL_GPL (dma_buf_vunmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );#ifdef CONFIG_DEBUG_FS static int dma_buf_debug_show (struct seq_file *s,void *unused)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3 -0
@@ -41,6 +41,7 @@#include <linux/swiotlb.h> #include <linux/dma-buf.h> #include <linux/sizes.h> +#include <linux/module.h> #include <drm/ttm/ttm_bo_api.h> #include <drm/ttm/ttm_bo_driver.h>
@@ -59,6 +60,8 @@#include "amdgpu_res_cursor.h" #include "bif/bif_4_1_d.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128 static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
drivers/gpu/drm/drm_gem_framebuffer_helper.c +3 -0
@@ -6,6 +6,7 @@*/ #include <linux/slab.h> +#include <linux/module.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fb_helper.h>
@@ -17,6 +18,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AFBC_HEADER_SIZE 16#define AFBC_TH_LAYOUT_ALIGNMENT 8#define AFBC_HDR_ALIGN 64
drivers/gpu/drm/drm_prime.c +3 -0
@@ -29,6 +29,7 @@#include <linux/export.h> #include <linux/dma-buf.h> #include <linux/rbtree.h> +#include <linux/module.h> #include <drm/drm.h> #include <drm/drm_drv.h>
@@ -39,6 +40,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * DOC: overview and lifetime rules *
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +3 -0
@@ -5,10 +5,13 @@#include <drm/drm_prime.h> #include <linux/dma-buf.h> +#include <linux/module.h> #include "etnaviv_drv.h" #include "etnaviv_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static struct lock_class_key etnaviv_prime_lock_class;struct sg_table *etnaviv_gem_prime_get_sg_table (struct drm_gem_object *obj)
drivers/gpu/drm/exynos/exynos_drm_gem.c +3 -0
@@ -9,6 +9,7 @@#include <linux/dma-buf.h> #include <linux/pfn_t.h> #include <linux/shmem_fs.h> +#include <linux/module.h> #include <drm/drm_prime.h> #include <drm/drm_vma_manager.h>
@@ -17,6 +18,8 @@#include "exynos_drm_drv.h" #include "exynos_drm_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static int exynos_drm_alloc_buf (struct exynos_drm_gem *exynos_gem,bool kvmap) {struct drm_device *dev = exynos_gem->base.dev;
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3 -0
@@ -7,11 +7,14 @@#include <linux/dma-buf.h> #include <linux/highmem.h> #include <linux/dma-resv.h> +#include <linux/module.h> #include "i915_drv.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" +MODULE_IMPORT_NS (DMA_BUF ); + I915_SELFTEST_DECLARE(static bool force_different_devices;) static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)
drivers/gpu/drm/tegra/gem.c +3 -0
@@ -12,6 +12,7 @@#include <linux/dma-buf.h> #include <linux/iommu.h> +#include <linux/module.h> #include <drm/drm_drv.h> #include <drm/drm_prime.h>
@@ -20,6 +21,8 @@#include "drm.h" #include "gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void tegra_bo_put (struct host1x_bo *bo) {struct tegra_bo *obj =host1x_to_tegra_bo (bo);
drivers/gpu/drm/vmwgfx/ttm_object.c +3 -0
@@ -48,8 +48,11 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/atomic.h> +#include <linux/module.h> #include "ttm_object.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * struct ttm_object_file *
drivers/infiniband/core/umem_dmabuf.c +3 -0
@@ -6,9 +6,12 @@#include <linux/dma-buf.h> #include <linux/dma-resv.h> #include <linux/dma-mapping.h> +#include <linux/module.h> #include "uverbs.h" +MODULE_IMPORT_NS (DMA_BUF ); +int ib_umem_dmabuf_map_pages (struct ib_umem_dmabuf *umem_dmabuf) {struct sg_table *sgt;
drivers/media/common/videobuf2/videobuf2-core.c +1 -0
@@ -2978,3 +2978,4 @@ EXPORT_SYMBOL_GPL(vb2_thread_stop);MODULE_DESCRIPTION ("Media buffer core framework" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>, Marek Szyprowski" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );
drivers/media/common/videobuf2/videobuf2-dma-contig.c +1 -0
@@ -755,3 +755,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);MODULE_DESCRIPTION ("DMA-contig memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );
drivers/media/common/videobuf2/videobuf2-dma-sg.c +1 -0
@@ -666,3 +666,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_sg_memops);MODULE_DESCRIPTION ("dma scatter/gather memory handling routines for videobuf2" );MODULE_AUTHOR ("Andrzej Pietrasiewicz" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );
drivers/media/common/videobuf2/videobuf2-vmalloc.c +1 -0
@@ -444,3 +444,4 @@ EXPORT_SYMBOL_GPL(vb2_vmalloc_memops);MODULE_DESCRIPTION ("vmalloc memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );
drivers/misc/fastrpc.c +1 -0
@@ -1763,3 +1763,4 @@ static void fastrpc_exit(void)module_exit (fastrpc_exit);MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (DMA_BUF );
drivers/staging/media/tegra-vde/dmabuf-cache.c +3 -0
@@ -12,9 +12,12 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/workqueue.h> +#include <linux/module.h> #include "vde.h" +MODULE_IMPORT_NS (DMA_BUF ); +struct tegra_vde_cache_entry {enum dma_data_direction dma_dir;struct dma_buf_attachment *a;
drivers/tee/tee_shm.c +3 -0
@@ -10,8 +10,11 @@#include <linux/slab.h> #include <linux/tee_drv.h> #include <linux/uio.h> +#include <linux/module.h> #include "tee_private.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void release_registered_pages (struct tee_shm *shm) {if (shm->pages) {
drivers/virtio/virtio_dma_buf.c +1 -0
@@ -86,3 +86,4 @@ int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf,EXPORT_SYMBOL (virtio_dma_buf_get_uuid);MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );
drivers/xen/gntdev-dmabuf.c +3 -0
@@ -14,6 +14,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <linux/module.h> #include <xen/xen.h> #include <xen/grant_table.h>
@@ -21,6 +22,8 @@#include "gntdev-common.h" #include "gntdev-dmabuf.h" +MODULE_IMPORT_NS (DMA_BUF ); +#ifndef GRANT_INVALID_REF /* * Note on usage of grant reference 0 as invalid grant reference:
samples/vfio-mdev/mbochs.c +1 -0
@@ -1493,5 +1493,6 @@ static void __exit mbochs_dev_exit(void) mbochs_class =NULL ; } +MODULE_IMPORT_NS (DMA_BUF );module_init (mbochs_dev_init)module_exit (mbochs_dev_exit)
Signature · 1 line
2.33.0
Quoted 12 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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
Quoted 13 lines
Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 7 lines
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
I've added it to my build box doing arm32/arm64/x86 randconfig tests, if it doesn't report anything by Monday, it's probably good in that regard.
Arnd
Arnd Bergmann
maintainerQuoted 7 lines · Arnd Bergmann
Quoted 2 lines · Greg Kroah-Hartman
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
I've added it to my build box doing arm32/arm64/x86 randconfig tests, if it doesn't report anything by Monday, it's probably good in that regard.
It found these two, please fold into your patch:
(quoted diff) +0 -0
b/drivers/gpu/drm/armada/armada_gem.c
index 21909642ee4c..711f0cca6f9c 100644
drivers/gpu/drm/armada/armada_gem.c +2 -0
@@ -15,6 +15,8 @@#include "armada_gem.h" #include "armada_ioctlP.h" +MODULE_IMPORT_NS (DMA_BUF ); +static vm_fault_t armada_gem_vm_fault (struct vm_fault *vmf) {struct drm_gem_object *gobj = vmf->vma->vm_private_data;
(quoted diff) +0 -0
b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
index f4cde3a169d8..809f86cfc540 100644
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +2 -0
@@ -11,6 +11,8 @@#include "omap_drv.h" +MODULE_IMPORT_NS (DMA_BUF ); +/* ----------------------------------------------------------------------------- * DMABUF Export */
Greg Kroah-Hartman
maintainerQuoted 10 lines · Arnd Bergmann
Quoted 7 lines · Arnd Bergmann
Quoted 2 lines · Greg Kroah-Hartman
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
I've added it to my build box doing arm32/arm64/x86 randconfig tests, if it doesn't report anything by Monday, it's probably good in that regard.
It found these two, please fold into your patch:
Now folded in, odd that 0-day didn't find it...
Thanks for the ack as well, I'll send out a v2 soon.
greg k-h
Am 25.09.21 um 15:47 schrieb Greg Kroah-Hartman:
Quoted 11 lines
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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
Quoted 13 lines
Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 487 lines
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
Comments?
drivers/dma-buf/dma-buf.c | 34 +++++++++---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++ drivers/gpu/drm/drm_prime.c | 3 ++ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 3 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++ drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++ drivers/gpu/drm/tegra/gem.c | 3 ++ drivers/gpu/drm/vmwgfx/ttm_object.c | 3 ++ drivers/infiniband/core/umem_dmabuf.c | 3 ++ .../media/common/videobuf2/videobuf2-core.c | 1 + .../common/videobuf2/videobuf2-dma-contig.c | 1 + .../media/common/videobuf2/videobuf2-dma-sg.c | 1 + .../common/videobuf2/videobuf2-vmalloc.c | 1 + drivers/misc/fastrpc.c | 1 + .../staging/media/tegra-vde/dmabuf-cache.c | 3 ++ drivers/tee/tee_shm.c | 3 ++ drivers/virtio/virtio_dma_buf.c | 1 + drivers/xen/gntdev-dmabuf.c | 3 ++ samples/vfio-mdev/mbochs.c | 1 + 20 files changed, 60 insertions(+), 17 deletions(-)drivers/dma-buf/dma-buf.c +17
-17@@ -610,7 +610,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)module_put (exp_info->owner);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_export); +EXPORT_SYMBOL_NS_GPL (dma_buf_export,DMA_BUF );/** * dma_buf_fd - returns a file descriptor for the given struct dma_buf @@ -634,7 +634,7 @@ int dma_buf_fd(struct dma_buf *dmabuf, int flags)return fd; } -EXPORT_SYMBOL_GPL (dma_buf_fd); +EXPORT_SYMBOL_NS_GPL (dma_buf_fd,DMA_BUF );/** * dma_buf_get - returns the struct dma_buf related to an fd @@ -660,7 +660,7 @@ struct dma_buf *dma_buf_get(int fd)return file->private_data; } -EXPORT_SYMBOL_GPL (dma_buf_get); +EXPORT_SYMBOL_NS_GPL (dma_buf_get,DMA_BUF );/** * dma_buf_put - decreases refcount of the buffer @@ -679,7 +679,7 @@ void dma_buf_put(struct dma_buf *dmabuf)fput (dmabuf->file); } -EXPORT_SYMBOL_GPL (dma_buf_put); +EXPORT_SYMBOL_NS_GPL (dma_buf_put,DMA_BUF );static void mangle_sg_table (struct sg_table *sg_table) {@@ -810,7 +810,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,dma_buf_detach (dmabuf, attach);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_dynamic_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_dynamic_attach,DMA_BUF );/** * dma_buf_attach - Wrapper for dma_buf_dynamic_attach @@ -825,7 +825,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, {return dma_buf_dynamic_attach (dmabuf, dev,NULL ,NULL ); } -EXPORT_SYMBOL_GPL (dma_buf_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_attach,DMA_BUF ); static void __unmap_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sg_table,@@ -871,7 +871,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)kfree (attach); } -EXPORT_SYMBOL_GPL (dma_buf_detach); +EXPORT_SYMBOL_NS_GPL (dma_buf_detach,DMA_BUF );/** * dma_buf_pin - Lock down the DMA-buf @@ -901,7 +901,7 @@ int dma_buf_pin(struct dma_buf_attachment *attach)return ret; } -EXPORT_SYMBOL_GPL (dma_buf_pin); +EXPORT_SYMBOL_NS_GPL (dma_buf_pin,DMA_BUF );/** * dma_buf_unpin - Unpin a DMA-buf @@ -922,7 +922,7 @@ void dma_buf_unpin(struct dma_buf_attachment *attach)if (dmabuf->ops->unpin) dmabuf->ops->unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unpin); +EXPORT_SYMBOL_NS_GPL (dma_buf_unpin,DMA_BUF );/** * dma_buf_map_attachment - Returns the scatterlist table of the attachment; @@ -1012,7 +1012,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,#endif /* CONFIG_DMA_API_DEBUG */ return sg_table; } -EXPORT_SYMBOL_GPL (dma_buf_map_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF );/** * dma_buf_unmap_attachment - unmaps and decreases usecount of the buffer;might @@ -1048,7 +1048,7 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, !IS_ENABLED(CONFIG_DMABUF_MOVE_NOTIFY))dma_buf_unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unmap_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF );/** * dma_buf_move_notify - notify attachments that DMA-buf is moving @@ -1068,7 +1068,7 @@ void dma_buf_move_notify(struct dma_buf *dmabuf)if (attach->importer_ops) attach->importer_ops->move_notify (attach); } -EXPORT_SYMBOL_GPL (dma_buf_move_notify); +EXPORT_SYMBOL_NS_GPL (dma_buf_move_notify,DMA_BUF );/** * DOC: cpu access @@ -1212,7 +1212,7 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_begin_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_begin_cpu_access,DMA_BUF );/** * dma_buf_end_cpu_access - Must be called after accessing a dma_buf from the @@ -1240,7 +1240,7 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_end_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_end_cpu_access,DMA_BUF );/** @@ -1282,7 +1282,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,return dmabuf->ops->mmap (dmabuf, vma); } -EXPORT_SYMBOL_GPL (dma_buf_mmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );/** * dma_buf_vmap - Create virtual mapping for the buffer object into kernel @@ -1336,7 +1336,7 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)mutex_unlock (&dmabuf->lock);return ret; } -EXPORT_SYMBOL_GPL (dma_buf_vmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap. @@ -1360,7 +1360,7 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) }mutex_unlock (&dmabuf->lock); } -EXPORT_SYMBOL_GPL (dma_buf_vunmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );#ifdef CONFIG_DEBUG_FS static int dma_buf_debug_show (struct seq_file *s,void *unused)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-0@@ -41,6 +41,7 @@#include <linux/swiotlb.h> #include <linux/dma-buf.h> #include <linux/sizes.h> +#include <linux/module.h> #include <drm/ttm/ttm_bo_api.h> #include <drm/ttm/ttm_bo_driver.h> @@ -59,6 +60,8 @@#include "amdgpu_res_cursor.h" #include "bif/bif_4_1_d.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128 static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,drivers/gpu/drm/drm_gem_framebuffer_helper.c +3
-0@@ -6,6 +6,7 @@*/ #include <linux/slab.h> +#include <linux/module.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fb_helper.h> @@ -17,6 +18,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AFBC_HEADER_SIZE 16#define AFBC_TH_LAYOUT_ALIGNMENT 8#define AFBC_HDR_ALIGN 64drivers/gpu/drm/drm_prime.c +3
-0@@ -29,6 +29,7 @@#include <linux/export.h> #include <linux/dma-buf.h> #include <linux/rbtree.h> +#include <linux/module.h> #include <drm/drm.h> #include <drm/drm_drv.h> @@ -39,6 +40,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * DOC: overview and lifetime rules * drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +3
-0@@ -5,10 +5,13 @@#include <drm/drm_prime.h> #include <linux/dma-buf.h> +#include <linux/module.h> #include "etnaviv_drv.h" #include "etnaviv_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static struct lock_class_key etnaviv_prime_lock_class;struct sg_table *etnaviv_gem_prime_get_sg_table (struct drm_gem_object *obj)drivers/gpu/drm/exynos/exynos_drm_gem.c +3
-0@@ -9,6 +9,7 @@#include <linux/dma-buf.h> #include <linux/pfn_t.h> #include <linux/shmem_fs.h> +#include <linux/module.h> #include <drm/drm_prime.h> #include <drm/drm_vma_manager.h> @@ -17,6 +18,8 @@#include "exynos_drm_drv.h" #include "exynos_drm_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static int exynos_drm_alloc_buf (struct exynos_drm_gem *exynos_gem,bool kvmap) {struct drm_device *dev = exynos_gem->base.dev;drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3
-0@@ -7,11 +7,14 @@#include <linux/dma-buf.h> #include <linux/highmem.h> #include <linux/dma-resv.h> +#include <linux/module.h> #include "i915_drv.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" +MODULE_IMPORT_NS (DMA_BUF ); + I915_SELFTEST_DECLARE(static bool force_different_devices;) static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)drivers/gpu/drm/tegra/gem.c +3
-0@@ -12,6 +12,7 @@#include <linux/dma-buf.h> #include <linux/iommu.h> +#include <linux/module.h> #include <drm/drm_drv.h> #include <drm/drm_prime.h> @@ -20,6 +21,8 @@#include "drm.h" #include "gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void tegra_bo_put (struct host1x_bo *bo) {struct tegra_bo *obj =host1x_to_tegra_bo (bo);drivers/gpu/drm/vmwgfx/ttm_object.c +3
-0@@ -48,8 +48,11 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/atomic.h> +#include <linux/module.h> #include "ttm_object.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * struct ttm_object_file * drivers/infiniband/core/umem_dmabuf.c +3
-0@@ -6,9 +6,12 @@#include <linux/dma-buf.h> #include <linux/dma-resv.h> #include <linux/dma-mapping.h> +#include <linux/module.h> #include "uverbs.h" +MODULE_IMPORT_NS (DMA_BUF ); +int ib_umem_dmabuf_map_pages (struct ib_umem_dmabuf *umem_dmabuf) {struct sg_table *sgt;drivers/media/common/videobuf2/videobuf2-core.c +1
-0@@ -2978,3 +2978,4 @@ EXPORT_SYMBOL_GPL(vb2_thread_stop);MODULE_DESCRIPTION ("Media buffer core framework" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>, Marek Szyprowski" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-contig.c +1
-0@@ -755,3 +755,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);MODULE_DESCRIPTION ("DMA-contig memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-sg.c +1
-0@@ -666,3 +666,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_sg_memops);MODULE_DESCRIPTION ("dma scatter/gather memory handling routines for videobuf2" );MODULE_AUTHOR ("Andrzej Pietrasiewicz" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-vmalloc.c +1
-0@@ -444,3 +444,4 @@ EXPORT_SYMBOL_GPL(vb2_vmalloc_memops);MODULE_DESCRIPTION ("vmalloc memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/misc/fastrpc.c +1
-0@@ -1763,3 +1763,4 @@ static void fastrpc_exit(void)module_exit (fastrpc_exit);MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/staging/media/tegra-vde/dmabuf-cache.c +3
-0@@ -12,9 +12,12 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/workqueue.h> +#include <linux/module.h> #include "vde.h" +MODULE_IMPORT_NS (DMA_BUF ); +struct tegra_vde_cache_entry {enum dma_data_direction dma_dir;struct dma_buf_attachment *a;drivers/tee/tee_shm.c +3
-0@@ -10,8 +10,11 @@#include <linux/slab.h> #include <linux/tee_drv.h> #include <linux/uio.h> +#include <linux/module.h> #include "tee_private.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void release_registered_pages (struct tee_shm *shm) {if (shm->pages) {drivers/virtio/virtio_dma_buf.c +1
-0@@ -86,3 +86,4 @@ int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf,EXPORT_SYMBOL (virtio_dma_buf_get_uuid);MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/xen/gntdev-dmabuf.c +3
-0@@ -14,6 +14,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <linux/module.h> #include <xen/xen.h> #include <xen/grant_table.h> @@ -21,6 +22,8 @@#include "gntdev-common.h" #include "gntdev-dmabuf.h" +MODULE_IMPORT_NS (DMA_BUF ); +#ifndef GRANT_INVALID_REF /* * Note on usage of grant reference 0 as invalid grant reference: samples/vfio-mdev/mbochs.c +1
-0@@ -1493,5 +1493,6 @@ static void __exit mbochs_dev_exit(void) mbochs_class =NULL ; } +MODULE_IMPORT_NS (DMA_BUF );module_init (mbochs_dev_init)module_exit (mbochs_dev_exit)
Greg Kroah-Hartman
maintainerQuoted 26 lines · Christian König
Am 25.09.21 um 15:47 schrieb Greg Kroah-Hartman:
Quoted 11 lines
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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_BUFQuoted 13 lines
Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 1 line
Acked-by Christian König <[email protected]>
Thanks for the ack.
greg k-h
Hello Greg,
Thanks for the patch!
Quoted 11 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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
Quoted 14 lines
Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
With the addition of the 2 misses found by Arnd, please feel free to add my
Quoted 517 lines
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
Comments?
drivers/dma-buf/dma-buf.c | 34 +++++++++---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++ drivers/gpu/drm/drm_prime.c | 3 ++ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 3 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++ drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++ drivers/gpu/drm/tegra/gem.c | 3 ++ drivers/gpu/drm/vmwgfx/ttm_object.c | 3 ++ drivers/infiniband/core/umem_dmabuf.c | 3 ++ .../media/common/videobuf2/videobuf2-core.c | 1 + .../common/videobuf2/videobuf2-dma-contig.c | 1 + .../media/common/videobuf2/videobuf2-dma-sg.c | 1 + .../common/videobuf2/videobuf2-vmalloc.c | 1 + drivers/misc/fastrpc.c | 1 + .../staging/media/tegra-vde/dmabuf-cache.c | 3 ++ drivers/tee/tee_shm.c | 3 ++ drivers/virtio/virtio_dma_buf.c | 1 + drivers/xen/gntdev-dmabuf.c | 3 ++ samples/vfio-mdev/mbochs.c | 1 + 20 files changed, 60 insertions(+), 17 deletions(-)drivers/dma-buf/dma-buf.c +1
-1@@ -610,7 +610,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) module_put(exp_info->owner);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_export); +EXPORT_SYMBOL_NS_GPL (dma_buf_export,DMA_BUF );/** *
dma_buf_fd- returns a file descriptor for the given structdma_bufdrivers/dma-buf/dma-buf.c +4
-4@@ -634,7 +634,7 @@ int dma_buf_fd(struct dma_buf *dmabuf, int flags)return fd; } -EXPORT_SYMBOL_GPL (dma_buf_fd); +EXPORT_SYMBOL_NS_GPL (dma_buf_fd,DMA_BUF );/** * dma_buf_get - returns the struct dma_buf related to an fd @@ -660,7 +660,7 @@ struct dma_buf *dma_buf_get(int fd)return file->private_data; } -EXPORT_SYMBOL_GPL (dma_buf_get); +EXPORT_SYMBOL_NS_GPL (dma_buf_get,DMA_BUF );/** * dma_buf_put - decreases refcount of the buffer @@ -679,7 +679,7 @@ void dma_buf_put(struct dma_buf *dmabuf)fput (dmabuf->file); } -EXPORT_SYMBOL_GPL (dma_buf_put); +EXPORT_SYMBOL_NS_GPL (dma_buf_put,DMA_BUF );static void mangle_sg_table (struct sg_table *sg_table) {@@ -810,7 +810,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, structdevice *dev,dma_buf_detach (dmabuf ,attach );return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_dynamic_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_dynamic_attach,DMA_BUF );/** *
dma_buf_attach- Wrapper fordma_buf_dynamic_attachdrivers/dma-buf/dma-buf.c +1
-1@@ -825,7 +825,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, {return dma_buf_dynamic_attach (dmabuf, dev,NULL ,NULL ); } -EXPORT_SYMBOL_GPL (dma_buf_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_attach,DMA_BUF ); static void __unmap_dma_buf(struct dma_buf_attachment *attach,struct
sg_table*sg_table,drivers/dma-buf/dma-buf.c +1
-1@@ -871,7 +871,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)kfree (attach ); } -EXPORT_SYMBOL_GPL (dma_buf_detach); +EXPORT_SYMBOL_NS_GPL (dma_buf_detach,DMA_BUF );/** *
dma_buf_pin- Lock down the DMA-bufdrivers/dma-buf/dma-buf.c +2
-2@@ -901,7 +901,7 @@ int dma_buf_pin(struct dma_buf_attachment *attach)return ret; } -EXPORT_SYMBOL_GPL (dma_buf_pin); +EXPORT_SYMBOL_NS_GPL (dma_buf_pin,DMA_BUF );/** * dma_buf_unpin - Unpin a DMA-buf @@ -922,7 +922,7 @@ void dma_buf_unpin(struct dma_buf_attachment *attach)if (dmabuf->ops->unpin) dmabuf->ops->unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unpin); +EXPORT_SYMBOL_NS_GPL (dma_buf_unpin,DMA_BUF );/** * dma_buf_map_attachment - Returns the scatterlist table of the attachment;
drivers/dma-buf/dma-buf.c +1
-1@@ -1012,7 +1012,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,#endif /* CONFIG_DMA_API_DEBUG */ return sg_table; } -EXPORT_SYMBOL_GPL (dma_buf_map_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF );/** *
dma_buf_unmap_attachment- unmaps and decreases usecount of the
buffer;mightdrivers/dma-buf/dma-buf.c +1
-1@@ -1048,7 +1048,7 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, !IS_ENABLED(CONFIG_DMABUF_MOVE_NOTIFY))dma_buf_unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unmap_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF );/** *
dma_buf_move_notify- notify attachments that DMA-buf is movingdrivers/dma-buf/dma-buf.c +2
-2@@ -1068,7 +1068,7 @@ void dma_buf_move_notify(struct dma_buf *dmabuf)if (attach->importer_ops) attach->importer_ops->move_notify (attach); } -EXPORT_SYMBOL_GPL (dma_buf_move_notify); +EXPORT_SYMBOL_NS_GPL (dma_buf_move_notify,DMA_BUF );/** * DOC: cpu access @@ -1212,7 +1212,7 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_begin_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_begin_cpu_access,DMA_BUF );/** * dma_buf_end_cpu_access - Must be called after accessing a dma_buf from the
drivers/dma-buf/dma-buf.c +2
-2@@ -1240,7 +1240,7 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_end_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_end_cpu_access,DMA_BUF );/** @@ -1282,7 +1282,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, structvm_area_struct *vma, return dmabuf->ops->mmap(dmabuf, vma); } -EXPORT_SYMBOL_GPL (dma_buf_mmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );/** *
dma_buf_vmap- Create virtual mapping for the buffer object into kerneldrivers/dma-buf/dma-buf.c +1
-1@@ -1336,7 +1336,7 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map) mutex_unlock(&dmabuf->lock);return ret; } -EXPORT_SYMBOL_GPL (dma_buf_vmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );/** *
dma_buf_vunmap- Unmap a vmap obtained bydma_buf_vmap.drivers/dma-buf/dma-buf.c +1
-1@@ -1360,7 +1360,7 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) }mutex_unlock (&dmabuf->lock); } -EXPORT_SYMBOL_GPL (dma_buf_vunmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );#ifdef CONFIG_DEBUG_FS static int
dma_buf_debug_show(struct seq_file *s, void *unused)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-0@@ -41,6 +41,7 @@#include <linux/swiotlb.h> #include <linux/dma-buf.h> #include <linux/sizes.h> +#include <linux/module.h> #include <drm/ttm/ttm_bo_api.h> #include <drm/ttm/ttm_bo_driver.h> @@ -59,6 +60,8 @@#include "amdgpu_res_cursor.h" #include "bif/bif_4_1_d.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128 static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,drivers/gpu/drm/drm_gem_framebuffer_helper.c +3
-0@@ -6,6 +6,7 @@*/ #include <linux/slab.h> +#include <linux/module.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fb_helper.h> @@ -17,6 +18,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AFBC_HEADER_SIZE 16#define AFBC_TH_LAYOUT_ALIGNMENT 8#define AFBC_HDR_ALIGN 64drivers/gpu/drm/drm_prime.c +3
-0@@ -29,6 +29,7 @@#include <linux/export.h> #include <linux/dma-buf.h> #include <linux/rbtree.h> +#include <linux/module.h> #include <drm/drm.h> #include <drm/drm_drv.h> @@ -39,6 +40,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * DOC: overview and lifetime rules * drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +3
-0@@ -5,10 +5,13 @@#include <drm/drm_prime.h> #include <linux/dma-buf.h> +#include <linux/module.h> #include "etnaviv_drv.h" #include "etnaviv_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static struct lock_class_key etnaviv_prime_lock_class; struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object*obj)
drivers/gpu/drm/exynos/exynos_drm_gem.c +3
-0@@ -9,6 +9,7 @@#include <linux/dma-buf.h> #include <linux/pfn_t.h> #include <linux/shmem_fs.h> +#include <linux/module.h> #include <drm/drm_prime.h> #include <drm/drm_vma_manager.h> @@ -17,6 +18,8 @@#include "exynos_drm_drv.h" #include "exynos_drm_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static int exynos_drm_alloc_buf (struct exynos_drm_gem *exynos_gem,bool kvmap) {struct drm_device *dev = exynos_gem->base.dev;drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3
-0@@ -7,11 +7,14 @@#include <linux/dma-buf.h> #include <linux/highmem.h> #include <linux/dma-resv.h> +#include <linux/module.h> #include "i915_drv.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" +MODULE_IMPORT_NS (DMA_BUF ); + I915_SELFTEST_DECLARE(static bool force_different_devices;) static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)drivers/gpu/drm/tegra/gem.c +3
-0@@ -12,6 +12,7 @@#include <linux/dma-buf.h> #include <linux/iommu.h> +#include <linux/module.h> #include <drm/drm_drv.h> #include <drm/drm_prime.h> @@ -20,6 +21,8 @@#include "drm.h" #include "gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void tegra_bo_put (struct host1x_bo *bo) {struct tegra_bo *obj =host1x_to_tegra_bo (bo);drivers/gpu/drm/vmwgfx/ttm_object.c +3
-0@@ -48,8 +48,11 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/atomic.h> +#include <linux/module.h> #include "ttm_object.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * struct ttm_object_file * drivers/infiniband/core/umem_dmabuf.c +3
-0@@ -6,9 +6,12 @@#include <linux/dma-buf.h> #include <linux/dma-resv.h> #include <linux/dma-mapping.h> +#include <linux/module.h> #include "uverbs.h" +MODULE_IMPORT_NS (DMA_BUF ); +int ib_umem_dmabuf_map_pages (struct ib_umem_dmabuf *umem_dmabuf) {struct sg_table *sgt;drivers/media/common/videobuf2/videobuf2-core.c +1
-0@@ -2978,3 +2978,4 @@ EXPORT_SYMBOL_GPL(vb2_thread_stop);MODULE_DESCRIPTION ("Media buffer core framework" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>, Marek Szyprowski" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-contig.c +1
-0@@ -755,3 +755,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);MODULE_DESCRIPTION ("DMA-contig memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-sg.c +1
-0@@ -666,3 +666,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_sg_memops);MODULE_DESCRIPTION ("dma scatter/gather memory handling routines for videobuf2");MODULE_AUTHOR ("Andrzej Pietrasiewicz" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-vmalloc.c +1
-0@@ -444,3 +444,4 @@ EXPORT_SYMBOL_GPL(vb2_vmalloc_memops);MODULE_DESCRIPTION ("vmalloc memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/misc/fastrpc.c +1
-0@@ -1763,3 +1763,4 @@ static void fastrpc_exit(void)module_exit (fastrpc_exit);MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/staging/media/tegra-vde/dmabuf-cache.c +3
-0@@ -12,9 +12,12 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/workqueue.h> +#include <linux/module.h> #include "vde.h" +MODULE_IMPORT_NS (DMA_BUF ); +struct tegra_vde_cache_entry {enum dma_data_direction dma_dir;struct dma_buf_attachment *a;drivers/tee/tee_shm.c +3
-0@@ -10,8 +10,11 @@#include <linux/slab.h> #include <linux/tee_drv.h> #include <linux/uio.h> +#include <linux/module.h> #include "tee_private.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void release_registered_pages (struct tee_shm *shm) {if (shm->pages) {drivers/virtio/virtio_dma_buf.c +1
-0@@ -86,3 +86,4 @@ int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf,EXPORT_SYMBOL (virtio_dma_buf_get_uuid);MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/xen/gntdev-dmabuf.c +3
-0@@ -14,6 +14,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <linux/module.h> #include <xen/xen.h> #include <xen/grant_table.h> @@ -21,6 +22,8 @@#include "gntdev-common.h" #include "gntdev-dmabuf.h" +MODULE_IMPORT_NS (DMA_BUF ); +#ifndef GRANT_INVALID_REF /* * Note on usage of grant reference 0 as invalid grant reference: samples/vfio-mdev/mbochs.c +1
-1@@ -1493,5 +1493,6 @@ static void __exit mbochs_dev_exit(void) mbochs_class =NULL ; } +MODULE_IMPORT_NS (DMA_BUF );module_init (mbochs_dev_init)module_exit (mbochs_dev_exit) --
Quoted 3 lines
2.33.0
Best,
Sumit.
Alex Deucher
Acked-byQuoted 33 lines · Sumit Semwal
Hello Greg,
Thanks for the patch!
Quoted 12 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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_BUFQuoted 13 lines
Cc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 2 lines
With the addition of the 2 misses found by Arnd, please feel free to add my
Acked-by Sumit Semwal <[email protected]>
Same here.
Quoted 495 lines
Quoted 490 lines
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
Comments?
drivers/dma-buf/dma-buf.c | 34 +++++++++---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++ drivers/gpu/drm/drm_prime.c | 3 ++ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 3 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++ drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++ drivers/gpu/drm/tegra/gem.c | 3 ++ drivers/gpu/drm/vmwgfx/ttm_object.c | 3 ++ drivers/infiniband/core/umem_dmabuf.c | 3 ++ .../media/common/videobuf2/videobuf2-core.c | 1 + .../common/videobuf2/videobuf2-dma-contig.c | 1 + .../media/common/videobuf2/videobuf2-dma-sg.c | 1 + .../common/videobuf2/videobuf2-vmalloc.c | 1 + drivers/misc/fastrpc.c | 1 + .../staging/media/tegra-vde/dmabuf-cache.c | 3 ++ drivers/tee/tee_shm.c | 3 ++ drivers/virtio/virtio_dma_buf.c | 1 + drivers/xen/gntdev-dmabuf.c | 3 ++ samples/vfio-mdev/mbochs.c | 1 + 20 files changed, 60 insertions(+), 17 deletions(-)drivers/dma-buf/dma-buf.c +17
-17@@ -610,7 +610,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)module_put (exp_info->owner);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_export); +EXPORT_SYMBOL_NS_GPL (dma_buf_export,DMA_BUF );/** * dma_buf_fd - returns a file descriptor for the given struct dma_buf @@ -634,7 +634,7 @@ int dma_buf_fd(struct dma_buf *dmabuf, int flags)return fd; } -EXPORT_SYMBOL_GPL (dma_buf_fd); +EXPORT_SYMBOL_NS_GPL (dma_buf_fd,DMA_BUF );/** * dma_buf_get - returns the struct dma_buf related to an fd @@ -660,7 +660,7 @@ struct dma_buf *dma_buf_get(int fd)return file->private_data; } -EXPORT_SYMBOL_GPL (dma_buf_get); +EXPORT_SYMBOL_NS_GPL (dma_buf_get,DMA_BUF );/** * dma_buf_put - decreases refcount of the buffer @@ -679,7 +679,7 @@ void dma_buf_put(struct dma_buf *dmabuf)fput (dmabuf->file); } -EXPORT_SYMBOL_GPL (dma_buf_put); +EXPORT_SYMBOL_NS_GPL (dma_buf_put,DMA_BUF );static void mangle_sg_table (struct sg_table *sg_table) {@@ -810,7 +810,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,dma_buf_detach (dmabuf, attach);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_dynamic_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_dynamic_attach,DMA_BUF );/** * dma_buf_attach - Wrapper for dma_buf_dynamic_attach @@ -825,7 +825,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, {return dma_buf_dynamic_attach (dmabuf, dev,NULL ,NULL ); } -EXPORT_SYMBOL_GPL (dma_buf_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_attach,DMA_BUF ); static void __unmap_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sg_table,@@ -871,7 +871,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)kfree (attach); } -EXPORT_SYMBOL_GPL (dma_buf_detach); +EXPORT_SYMBOL_NS_GPL (dma_buf_detach,DMA_BUF );/** * dma_buf_pin - Lock down the DMA-buf @@ -901,7 +901,7 @@ int dma_buf_pin(struct dma_buf_attachment *attach)return ret; } -EXPORT_SYMBOL_GPL (dma_buf_pin); +EXPORT_SYMBOL_NS_GPL (dma_buf_pin,DMA_BUF );/** * dma_buf_unpin - Unpin a DMA-buf @@ -922,7 +922,7 @@ void dma_buf_unpin(struct dma_buf_attachment *attach)if (dmabuf->ops->unpin) dmabuf->ops->unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unpin); +EXPORT_SYMBOL_NS_GPL (dma_buf_unpin,DMA_BUF );/** * dma_buf_map_attachment - Returns the scatterlist table of the attachment; @@ -1012,7 +1012,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,#endif /* CONFIG_DMA_API_DEBUG */ return sg_table; } -EXPORT_SYMBOL_GPL (dma_buf_map_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF );/** * dma_buf_unmap_attachment - unmaps and decreases usecount of the buffer;might @@ -1048,7 +1048,7 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, !IS_ENABLED(CONFIG_DMABUF_MOVE_NOTIFY))dma_buf_unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unmap_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF );/** * dma_buf_move_notify - notify attachments that DMA-buf is moving @@ -1068,7 +1068,7 @@ void dma_buf_move_notify(struct dma_buf *dmabuf)if (attach->importer_ops) attach->importer_ops->move_notify (attach); } -EXPORT_SYMBOL_GPL (dma_buf_move_notify); +EXPORT_SYMBOL_NS_GPL (dma_buf_move_notify,DMA_BUF );/** * DOC: cpu access @@ -1212,7 +1212,7 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_begin_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_begin_cpu_access,DMA_BUF );/** * dma_buf_end_cpu_access - Must be called after accessing a dma_buf from the @@ -1240,7 +1240,7 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_end_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_end_cpu_access,DMA_BUF );/** @@ -1282,7 +1282,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,return dmabuf->ops->mmap (dmabuf, vma); } -EXPORT_SYMBOL_GPL (dma_buf_mmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );/** * dma_buf_vmap - Create virtual mapping for the buffer object into kernel @@ -1336,7 +1336,7 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)mutex_unlock (&dmabuf->lock);return ret; } -EXPORT_SYMBOL_GPL (dma_buf_vmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap. @@ -1360,7 +1360,7 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) }mutex_unlock (&dmabuf->lock); } -EXPORT_SYMBOL_GPL (dma_buf_vunmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );#ifdef CONFIG_DEBUG_FS static int dma_buf_debug_show (struct seq_file *s,void *unused)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-0@@ -41,6 +41,7 @@#include <linux/swiotlb.h> #include <linux/dma-buf.h> #include <linux/sizes.h> +#include <linux/module.h> #include <drm/ttm/ttm_bo_api.h> #include <drm/ttm/ttm_bo_driver.h> @@ -59,6 +60,8 @@#include "amdgpu_res_cursor.h" #include "bif/bif_4_1_d.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128 static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,drivers/gpu/drm/drm_gem_framebuffer_helper.c +3
-0@@ -6,6 +6,7 @@*/ #include <linux/slab.h> +#include <linux/module.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fb_helper.h> @@ -17,6 +18,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AFBC_HEADER_SIZE 16#define AFBC_TH_LAYOUT_ALIGNMENT 8#define AFBC_HDR_ALIGN 64drivers/gpu/drm/drm_prime.c +3
-0@@ -29,6 +29,7 @@#include <linux/export.h> #include <linux/dma-buf.h> #include <linux/rbtree.h> +#include <linux/module.h> #include <drm/drm.h> #include <drm/drm_drv.h> @@ -39,6 +40,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * DOC: overview and lifetime rules * drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +3
-0@@ -5,10 +5,13 @@#include <drm/drm_prime.h> #include <linux/dma-buf.h> +#include <linux/module.h> #include "etnaviv_drv.h" #include "etnaviv_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static struct lock_class_key etnaviv_prime_lock_class;struct sg_table *etnaviv_gem_prime_get_sg_table (struct drm_gem_object *obj)drivers/gpu/drm/exynos/exynos_drm_gem.c +3
-0@@ -9,6 +9,7 @@#include <linux/dma-buf.h> #include <linux/pfn_t.h> #include <linux/shmem_fs.h> +#include <linux/module.h> #include <drm/drm_prime.h> #include <drm/drm_vma_manager.h> @@ -17,6 +18,8 @@#include "exynos_drm_drv.h" #include "exynos_drm_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static int exynos_drm_alloc_buf (struct exynos_drm_gem *exynos_gem,bool kvmap) {struct drm_device *dev = exynos_gem->base.dev;drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3
-0@@ -7,11 +7,14 @@#include <linux/dma-buf.h> #include <linux/highmem.h> #include <linux/dma-resv.h> +#include <linux/module.h> #include "i915_drv.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" +MODULE_IMPORT_NS (DMA_BUF ); + I915_SELFTEST_DECLARE(static bool force_different_devices;) static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)drivers/gpu/drm/tegra/gem.c +3
-0@@ -12,6 +12,7 @@#include <linux/dma-buf.h> #include <linux/iommu.h> +#include <linux/module.h> #include <drm/drm_drv.h> #include <drm/drm_prime.h> @@ -20,6 +21,8 @@#include "drm.h" #include "gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void tegra_bo_put (struct host1x_bo *bo) {struct tegra_bo *obj =host1x_to_tegra_bo (bo);drivers/gpu/drm/vmwgfx/ttm_object.c +3
-0@@ -48,8 +48,11 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/atomic.h> +#include <linux/module.h> #include "ttm_object.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * struct ttm_object_file * drivers/infiniband/core/umem_dmabuf.c +3
-0@@ -6,9 +6,12 @@#include <linux/dma-buf.h> #include <linux/dma-resv.h> #include <linux/dma-mapping.h> +#include <linux/module.h> #include "uverbs.h" +MODULE_IMPORT_NS (DMA_BUF ); +int ib_umem_dmabuf_map_pages (struct ib_umem_dmabuf *umem_dmabuf) {struct sg_table *sgt;drivers/media/common/videobuf2/videobuf2-core.c +1
-0@@ -2978,3 +2978,4 @@ EXPORT_SYMBOL_GPL(vb2_thread_stop);MODULE_DESCRIPTION ("Media buffer core framework" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>, Marek Szyprowski" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-contig.c +1
-0@@ -755,3 +755,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);MODULE_DESCRIPTION ("DMA-contig memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-sg.c +1
-0@@ -666,3 +666,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_sg_memops);MODULE_DESCRIPTION ("dma scatter/gather memory handling routines for videobuf2" );MODULE_AUTHOR ("Andrzej Pietrasiewicz" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-vmalloc.c +1
-0@@ -444,3 +444,4 @@ EXPORT_SYMBOL_GPL(vb2_vmalloc_memops);MODULE_DESCRIPTION ("vmalloc memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/misc/fastrpc.c +1
-0@@ -1763,3 +1763,4 @@ static void fastrpc_exit(void)module_exit (fastrpc_exit);MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/staging/media/tegra-vde/dmabuf-cache.c +3
-0@@ -12,9 +12,12 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/workqueue.h> +#include <linux/module.h> #include "vde.h" +MODULE_IMPORT_NS (DMA_BUF ); +struct tegra_vde_cache_entry {enum dma_data_direction dma_dir;struct dma_buf_attachment *a;drivers/tee/tee_shm.c +3
-0@@ -10,8 +10,11 @@#include <linux/slab.h> #include <linux/tee_drv.h> #include <linux/uio.h> +#include <linux/module.h> #include "tee_private.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void release_registered_pages (struct tee_shm *shm) {if (shm->pages) {drivers/virtio/virtio_dma_buf.c +1
-0@@ -86,3 +86,4 @@ int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf,EXPORT_SYMBOL (virtio_dma_buf_get_uuid);MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/xen/gntdev-dmabuf.c +3
-0@@ -14,6 +14,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <linux/module.h> #include <xen/xen.h> #include <xen/grant_table.h> @@ -21,6 +22,8 @@#include "gntdev-common.h" #include "gntdev-dmabuf.h" +MODULE_IMPORT_NS (DMA_BUF ); +#ifndef GRANT_INVALID_REF /* * Note on usage of grant reference 0 as invalid grant reference: samples/vfio-mdev/mbochs.c +1
-1@@ -1493,5 +1493,6 @@ static void __exit mbochs_dev_exit(void) mbochs_class =NULL ; } +MODULE_IMPORT_NS (DMA_BUF );module_init (mbochs_dev_init)module_exit (mbochs_dev_exit) --Quoted 2 lines
2.33.0
Best,
Sumit.
Greg Kroah-Hartman
maintainerQuoted 34 lines · Alex Deucher
Quoted 33 lines · Sumit Semwal
Hello Greg,
Thanks for the patch!
Quoted 25 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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_BUFCc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 6 lines
Quoted 2 lines
With the addition of the 2 misses found by Arnd, please feel free to add my
Acked-by Sumit Semwal <[email protected]>Same here.
Acked-by Alex Deucher <[email protected]>
Thanks both of you for your acks.
greg k-h
Quoted 24 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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_BUFCc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 6 lines
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Yeah, the interesting ones is why I added the dma-buf wildcard match a while ago. Since that landed I don't think anything escaped. Should we perhaps also add
K: MODULE_IMPORT_NS(DMA_BUF);
to the dma-buf MAINATINERS entry? Entirely untested, also no idea whether there's not a better way to match for module namespaces. Either way:
Quoted 484 lines
Only test-built on x86 allmodconfig, don't know what other arches will pick up, will let 0-day run on it for a bit...
Comments?
drivers/dma-buf/dma-buf.c | 34 +++++++++---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ++ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 ++ drivers/gpu/drm/drm_prime.c | 3 ++ drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 3 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ++ drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 ++ drivers/gpu/drm/tegra/gem.c | 3 ++ drivers/gpu/drm/vmwgfx/ttm_object.c | 3 ++ drivers/infiniband/core/umem_dmabuf.c | 3 ++ .../media/common/videobuf2/videobuf2-core.c | 1 + .../common/videobuf2/videobuf2-dma-contig.c | 1 + .../media/common/videobuf2/videobuf2-dma-sg.c | 1 + .../common/videobuf2/videobuf2-vmalloc.c | 1 + drivers/misc/fastrpc.c | 1 + .../staging/media/tegra-vde/dmabuf-cache.c | 3 ++ drivers/tee/tee_shm.c | 3 ++ drivers/virtio/virtio_dma_buf.c | 1 + drivers/xen/gntdev-dmabuf.c | 3 ++ samples/vfio-mdev/mbochs.c | 1 + 20 files changed, 60 insertions(+), 17 deletions(-)drivers/dma-buf/dma-buf.c +17
-17@@ -610,7 +610,7 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)module_put (exp_info->owner);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_export); +EXPORT_SYMBOL_NS_GPL (dma_buf_export,DMA_BUF );/** * dma_buf_fd - returns a file descriptor for the given struct dma_buf @@ -634,7 +634,7 @@ int dma_buf_fd(struct dma_buf *dmabuf, int flags)return fd; } -EXPORT_SYMBOL_GPL (dma_buf_fd); +EXPORT_SYMBOL_NS_GPL (dma_buf_fd,DMA_BUF );/** * dma_buf_get - returns the struct dma_buf related to an fd @@ -660,7 +660,7 @@ struct dma_buf *dma_buf_get(int fd)return file->private_data; } -EXPORT_SYMBOL_GPL (dma_buf_get); +EXPORT_SYMBOL_NS_GPL (dma_buf_get,DMA_BUF );/** * dma_buf_put - decreases refcount of the buffer @@ -679,7 +679,7 @@ void dma_buf_put(struct dma_buf *dmabuf)fput (dmabuf->file); } -EXPORT_SYMBOL_GPL (dma_buf_put); +EXPORT_SYMBOL_NS_GPL (dma_buf_put,DMA_BUF );static void mangle_sg_table (struct sg_table *sg_table) {@@ -810,7 +810,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,dma_buf_detach (dmabuf, attach);return ERR_PTR (ret); } -EXPORT_SYMBOL_GPL (dma_buf_dynamic_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_dynamic_attach,DMA_BUF );/** * dma_buf_attach - Wrapper for dma_buf_dynamic_attach @@ -825,7 +825,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, {return dma_buf_dynamic_attach (dmabuf, dev,NULL ,NULL ); } -EXPORT_SYMBOL_GPL (dma_buf_attach); +EXPORT_SYMBOL_NS_GPL (dma_buf_attach,DMA_BUF ); static void __unmap_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sg_table,@@ -871,7 +871,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)kfree (attach); } -EXPORT_SYMBOL_GPL (dma_buf_detach); +EXPORT_SYMBOL_NS_GPL (dma_buf_detach,DMA_BUF );/** * dma_buf_pin - Lock down the DMA-buf @@ -901,7 +901,7 @@ int dma_buf_pin(struct dma_buf_attachment *attach)return ret; } -EXPORT_SYMBOL_GPL (dma_buf_pin); +EXPORT_SYMBOL_NS_GPL (dma_buf_pin,DMA_BUF );/** * dma_buf_unpin - Unpin a DMA-buf @@ -922,7 +922,7 @@ void dma_buf_unpin(struct dma_buf_attachment *attach)if (dmabuf->ops->unpin) dmabuf->ops->unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unpin); +EXPORT_SYMBOL_NS_GPL (dma_buf_unpin,DMA_BUF );/** * dma_buf_map_attachment - Returns the scatterlist table of the attachment; @@ -1012,7 +1012,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,#endif /* CONFIG_DMA_API_DEBUG */ return sg_table; } -EXPORT_SYMBOL_GPL (dma_buf_map_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_map_attachment,DMA_BUF );/** * dma_buf_unmap_attachment - unmaps and decreases usecount of the buffer;might @@ -1048,7 +1048,7 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, !IS_ENABLED(CONFIG_DMABUF_MOVE_NOTIFY))dma_buf_unpin (attach); } -EXPORT_SYMBOL_GPL (dma_buf_unmap_attachment); +EXPORT_SYMBOL_NS_GPL (dma_buf_unmap_attachment,DMA_BUF );/** * dma_buf_move_notify - notify attachments that DMA-buf is moving @@ -1068,7 +1068,7 @@ void dma_buf_move_notify(struct dma_buf *dmabuf)if (attach->importer_ops) attach->importer_ops->move_notify (attach); } -EXPORT_SYMBOL_GPL (dma_buf_move_notify); +EXPORT_SYMBOL_NS_GPL (dma_buf_move_notify,DMA_BUF );/** * DOC: cpu access @@ -1212,7 +1212,7 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_begin_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_begin_cpu_access,DMA_BUF );/** * dma_buf_end_cpu_access - Must be called after accessing a dma_buf from the @@ -1240,7 +1240,7 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf,return ret; } -EXPORT_SYMBOL_GPL (dma_buf_end_cpu_access); +EXPORT_SYMBOL_NS_GPL (dma_buf_end_cpu_access,DMA_BUF );/** @@ -1282,7 +1282,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,return dmabuf->ops->mmap (dmabuf, vma); } -EXPORT_SYMBOL_GPL (dma_buf_mmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_mmap,DMA_BUF );/** * dma_buf_vmap - Create virtual mapping for the buffer object into kernel @@ -1336,7 +1336,7 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct dma_buf_map *map)mutex_unlock (&dmabuf->lock);return ret; } -EXPORT_SYMBOL_GPL (dma_buf_vmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vmap,DMA_BUF );/** * dma_buf_vunmap - Unmap a vmap obtained by dma_buf_vmap. @@ -1360,7 +1360,7 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct dma_buf_map *map) }mutex_unlock (&dmabuf->lock); } -EXPORT_SYMBOL_GPL (dma_buf_vunmap); +EXPORT_SYMBOL_NS_GPL (dma_buf_vunmap,DMA_BUF );#ifdef CONFIG_DEBUG_FS static int dma_buf_debug_show (struct seq_file *s,void *unused)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +3
-0@@ -41,6 +41,7 @@#include <linux/swiotlb.h> #include <linux/dma-buf.h> #include <linux/sizes.h> +#include <linux/module.h> #include <drm/ttm/ttm_bo_api.h> #include <drm/ttm/ttm_bo_driver.h> @@ -59,6 +60,8 @@#include "amdgpu_res_cursor.h" #include "bif/bif_4_1_d.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AMDGPU_TTM_VRAM_MAX_DW_READ (size_t)128 static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,drivers/gpu/drm/drm_gem_framebuffer_helper.c +3
-0@@ -6,6 +6,7 @@*/ #include <linux/slab.h> +#include <linux/module.h> #include <drm/drm_damage_helper.h> #include <drm/drm_fb_helper.h> @@ -17,6 +18,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +#define AFBC_HEADER_SIZE 16#define AFBC_TH_LAYOUT_ALIGNMENT 8#define AFBC_HDR_ALIGN 64drivers/gpu/drm/drm_prime.c +3
-0@@ -29,6 +29,7 @@#include <linux/export.h> #include <linux/dma-buf.h> #include <linux/rbtree.h> +#include <linux/module.h> #include <drm/drm.h> #include <drm/drm_drv.h> @@ -39,6 +40,8 @@#include "drm_internal.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * DOC: overview and lifetime rules * drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +3
-0@@ -5,10 +5,13 @@#include <drm/drm_prime.h> #include <linux/dma-buf.h> +#include <linux/module.h> #include "etnaviv_drv.h" #include "etnaviv_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static struct lock_class_key etnaviv_prime_lock_class;struct sg_table *etnaviv_gem_prime_get_sg_table (struct drm_gem_object *obj)drivers/gpu/drm/exynos/exynos_drm_gem.c +3
-0@@ -9,6 +9,7 @@#include <linux/dma-buf.h> #include <linux/pfn_t.h> #include <linux/shmem_fs.h> +#include <linux/module.h> #include <drm/drm_prime.h> #include <drm/drm_vma_manager.h> @@ -17,6 +18,8 @@#include "exynos_drm_drv.h" #include "exynos_drm_gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static int exynos_drm_alloc_buf (struct exynos_drm_gem *exynos_gem,bool kvmap) {struct drm_device *dev = exynos_gem->base.dev;drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +3
-0@@ -7,11 +7,14 @@#include <linux/dma-buf.h> #include <linux/highmem.h> #include <linux/dma-resv.h> +#include <linux/module.h> #include "i915_drv.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" +MODULE_IMPORT_NS (DMA_BUF ); + I915_SELFTEST_DECLARE(static bool force_different_devices;) static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)drivers/gpu/drm/tegra/gem.c +3
-0@@ -12,6 +12,7 @@#include <linux/dma-buf.h> #include <linux/iommu.h> +#include <linux/module.h> #include <drm/drm_drv.h> #include <drm/drm_prime.h> @@ -20,6 +21,8 @@#include "drm.h" #include "gem.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void tegra_bo_put (struct host1x_bo *bo) {struct tegra_bo *obj =host1x_to_tegra_bo (bo);drivers/gpu/drm/vmwgfx/ttm_object.c +3
-0@@ -48,8 +48,11 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/atomic.h> +#include <linux/module.h> #include "ttm_object.h" +MODULE_IMPORT_NS (DMA_BUF ); +/** * struct ttm_object_file * drivers/infiniband/core/umem_dmabuf.c +3
-0@@ -6,9 +6,12 @@#include <linux/dma-buf.h> #include <linux/dma-resv.h> #include <linux/dma-mapping.h> +#include <linux/module.h> #include "uverbs.h" +MODULE_IMPORT_NS (DMA_BUF ); +int ib_umem_dmabuf_map_pages (struct ib_umem_dmabuf *umem_dmabuf) {struct sg_table *sgt;drivers/media/common/videobuf2/videobuf2-core.c +1
-0@@ -2978,3 +2978,4 @@ EXPORT_SYMBOL_GPL(vb2_thread_stop);MODULE_DESCRIPTION ("Media buffer core framework" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>, Marek Szyprowski" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-contig.c +1
-0@@ -755,3 +755,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_set_max_seg_size);MODULE_DESCRIPTION ("DMA-contig memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-dma-sg.c +1
-0@@ -666,3 +666,4 @@ EXPORT_SYMBOL_GPL(vb2_dma_sg_memops);MODULE_DESCRIPTION ("dma scatter/gather memory handling routines for videobuf2" );MODULE_AUTHOR ("Andrzej Pietrasiewicz" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/media/common/videobuf2/videobuf2-vmalloc.c +1
-0@@ -444,3 +444,4 @@ EXPORT_SYMBOL_GPL(vb2_vmalloc_memops);MODULE_DESCRIPTION ("vmalloc memory handling routines for videobuf2" );MODULE_AUTHOR ("Pawel Osciak <[email protected]>" );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/misc/fastrpc.c +1
-0@@ -1763,3 +1763,4 @@ static void fastrpc_exit(void)module_exit (fastrpc_exit);MODULE_LICENSE ("GPL v2" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/staging/media/tegra-vde/dmabuf-cache.c +3
-0@@ -12,9 +12,12 @@#include <linux/sched.h> #include <linux/slab.h> #include <linux/workqueue.h> +#include <linux/module.h> #include "vde.h" +MODULE_IMPORT_NS (DMA_BUF ); +struct tegra_vde_cache_entry {enum dma_data_direction dma_dir;struct dma_buf_attachment *a;drivers/tee/tee_shm.c +3
-0@@ -10,8 +10,11 @@#include <linux/slab.h> #include <linux/tee_drv.h> #include <linux/uio.h> +#include <linux/module.h> #include "tee_private.h" +MODULE_IMPORT_NS (DMA_BUF ); +static void release_registered_pages (struct tee_shm *shm) {if (shm->pages) {drivers/virtio/virtio_dma_buf.c +1
-0@@ -86,3 +86,4 @@ int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf,EXPORT_SYMBOL (virtio_dma_buf_get_uuid);MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (DMA_BUF );drivers/xen/gntdev-dmabuf.c +3
-0@@ -14,6 +14,7 @@#include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <linux/module.h> #include <xen/xen.h> #include <xen/grant_table.h> @@ -21,6 +22,8 @@#include "gntdev-common.h" #include "gntdev-dmabuf.h" +MODULE_IMPORT_NS (DMA_BUF ); +#ifndef GRANT_INVALID_REF /* * Note on usage of grant reference 0 as invalid grant reference: samples/vfio-mdev/mbochs.c +1
-0@@ -1493,5 +1493,6 @@ static void __exit mbochs_dev_exit(void) mbochs_class =NULL ; } +MODULE_IMPORT_NS (DMA_BUF );module_init (mbochs_dev_init)module_exit (mbochs_dev_exit)Signature · 1 line
2.33.0
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Greg Kroah-Hartman
maintainerQuoted 32 lines · Daniel Vetter
Quoted 24 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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_BUFCc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Quoted 6 lines
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Quoted 8 lines
Yeah, the interesting ones is why I added the dma-buf wildcard match a while ago. Since that landed I don't think anything escaped. Should we perhaps also add
K:
MODULE_IMPORT_NS(DMA_BUF);to the dma-buf MAINATINERS entry? Entirely untested, also no idea whether there's not a better way to match for module namespaces. Either way:
I don't know if that would really work, if anything, just make the MAINTAINERS file harder to maintain :)
Quoted 1 line
Acked-by Daniel Vetter <[email protected]>
Thanks for the review, I'll send out a v2 later today...
greg k-h
Greg Kroah-Hartman
maintainerQuoted 32 lines · Daniel Vetter
Quoted 24 lines · Greg Kroah-Hartman
In order to better track where in the kernel the dma-buf code is used, put the symbols in the namespace
DMA_BUFand 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_BUFCc Sumit Semwal <[email protected]>Cc "Christian König" <[email protected]>Cc Alex Deucher <[email protected]>Cc "Pan, Xinhui" <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Thomas Zimmermann <[email protected]>Cc Mauro Carvalho Chehab <[email protected]>Cc Arnd Bergmann <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Quoted 6 lines
---
The topic of dma-buf came up in the Maintainer's summit yesterday, and one comment was to put the symbols in their own module namespace, to make it easier to notice and track who was using them. This patch does so, and finds some "interesting" users of the api already in the tree.
Quoted 8 lines
Yeah, the interesting ones is why I added the dma-buf wildcard match a while ago. Since that landed I don't think anything escaped. Should we perhaps also add
K:
MODULE_IMPORT_NS(DMA_BUF);to the dma-buf MAINATINERS entry? Entirely untested, also no idea whether there's not a better way to match for module namespaces. Either way:
I think MAINTAINERS is already overloaded with too many of these things, but feel free to mess with it if you want to :)
Quoted 1 line
Acked-by Daniel Vetter <[email protected]>
Thanks for the ack!
greg k-h