Re: [PATCH v2] dma-buf: move dma-buf symbols into the DMA_BUF module namespace

2021-10-25 Thread Greg Kroah-Hartman
On Mon, Oct 25, 2021 at 05:43:49PM +0530, Sumit Semwal wrote:
> Hi Greg,
> 
> On Mon, 25 Oct 2021 at 16:29, Christian König  
> wrote:
> >
> > Am 25.10.21 um 12:36 schrieb Greg Kroah-Hartman:
> > > On Sun, Oct 10, 2021 at 02:46:28PM +0200, Greg Kroah-Hartman wrote:
> > >> 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" 
> > >> Cc: David Airlie 
> > >> Cc: Maarten Lankhorst 
> > >> Cc: Maxime Ripard 
> > >> Cc: Thomas Zimmermann 
> > >> Cc: Mauro Carvalho Chehab 
> > >> Cc: dri-devel@lists.freedesktop.org
> > >> Acked-by: Daniel Vetter 
> > >> Acked-by: Christian König 
> > >> Acked-by: Arnd Bergmann 
> > >> Acked-by: Sumit Semwal 
> > >> Acked-by: Alex Deucher 
> > >> Signed-off-by: Greg Kroah-Hartman 
> > >> ---
> > >> v2: added lots of acks
> > >>  added 2 more drivers that needed the change, as found by Arnd
> > > Ping?  Any ideas on what needs to happen to get this into the tree?
> > >
> > > Or can I take it through my char-misc tree?  I seem to have a bunch of
> > > acks on it by the respective maintainers...
> >
> > I could push that upstream through the drm-misc-next tree if you like,
> > but honestly char-misc sounds like the better approach since this
> > touches a lot of drivers outside of drm as well.
> 
> I agree with Christian here - char-misc might be a better way for this.

Good idea, I'll take it through this tree as it will need to add the
symbol to the habanalabs driver at the same time as it has picked up
support for these symbols in my tree.

thanks,

greg k-h


Re: [PATCH v2] dma-buf: move dma-buf symbols into the DMA_BUF module namespace

2021-10-25 Thread Sumit Semwal
Hi Greg,

On Mon, 25 Oct 2021 at 16:29, Christian König  wrote:
>
> Am 25.10.21 um 12:36 schrieb Greg Kroah-Hartman:
> > On Sun, Oct 10, 2021 at 02:46:28PM +0200, Greg Kroah-Hartman wrote:
> >> 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" 
> >> Cc: David Airlie 
> >> Cc: Maarten Lankhorst 
> >> Cc: Maxime Ripard 
> >> Cc: Thomas Zimmermann 
> >> Cc: Mauro Carvalho Chehab 
> >> Cc: dri-devel@lists.freedesktop.org
> >> Acked-by: Daniel Vetter 
> >> Acked-by: Christian König 
> >> Acked-by: Arnd Bergmann 
> >> Acked-by: Sumit Semwal 
> >> Acked-by: Alex Deucher 
> >> Signed-off-by: Greg Kroah-Hartman 
> >> ---
> >> v2: added lots of acks
> >>  added 2 more drivers that needed the change, as found by Arnd
> > Ping?  Any ideas on what needs to happen to get this into the tree?
> >
> > Or can I take it through my char-misc tree?  I seem to have a bunch of
> > acks on it by the respective maintainers...
>
> I could push that upstream through the drm-misc-next tree if you like,
> but honestly char-misc sounds like the better approach since this
> touches a lot of drivers outside of drm as well.

I agree with Christian here - char-misc might be a better way for this.

>
>
> Thanks,
> Christian.
>
> >
> > thanks,
> >
> > greg k-h
>

Best,
Sumit.


Re: [PATCH v2] dma-buf: move dma-buf symbols into the DMA_BUF module namespace

2021-10-25 Thread Christian König

Am 25.10.21 um 12:36 schrieb Greg Kroah-Hartman:

On Sun, Oct 10, 2021 at 02:46:28PM +0200, Greg Kroah-Hartman wrote:

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" 
Cc: David Airlie 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Thomas Zimmermann 
Cc: Mauro Carvalho Chehab 
Cc: dri-devel@lists.freedesktop.org
Acked-by: Daniel Vetter 
Acked-by: Christian König 
Acked-by: Arnd Bergmann 
Acked-by: Sumit Semwal 
Acked-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 
---
v2: added lots of acks
 added 2 more drivers that needed the change, as found by Arnd

Ping?  Any ideas on what needs to happen to get this into the tree?

Or can I take it through my char-misc tree?  I seem to have a bunch of
acks on it by the respective maintainers...


I could push that upstream through the drm-misc-next tree if you like, 
but honestly char-misc sounds like the better approach since this 
touches a lot of drivers outside of drm as well.


Thanks,
Christian.



thanks,

greg k-h




Re: [PATCH v2] dma-buf: move dma-buf symbols into the DMA_BUF module namespace

2021-10-25 Thread Greg Kroah-Hartman
On Sun, Oct 10, 2021 at 02:46:28PM +0200, Greg Kroah-Hartman wrote:
> 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" 
> Cc: David Airlie 
> Cc: Maarten Lankhorst 
> Cc: Maxime Ripard 
> Cc: Thomas Zimmermann 
> Cc: Mauro Carvalho Chehab 
> Cc: dri-devel@lists.freedesktop.org
> Acked-by: Daniel Vetter 
> Acked-by: Christian König 
> Acked-by: Arnd Bergmann 
> Acked-by: Sumit Semwal 
> Acked-by: Alex Deucher 
> Signed-off-by: Greg Kroah-Hartman 
> ---
> v2: added lots of acks
> added 2 more drivers that needed the change, as found by Arnd

Ping?  Any ideas on what needs to happen to get this into the tree?

Or can I take it through my char-misc tree?  I seem to have a bunch of
acks on it by the respective maintainers...

thanks,

greg k-h


[PATCH v2] dma-buf: move dma-buf symbols into the DMA_BUF module namespace

2021-10-10 Thread 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_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" 
Cc: David Airlie 
Cc: Maarten Lankhorst 
Cc: Maxime Ripard 
Cc: Thomas Zimmermann 
Cc: Mauro Carvalho Chehab 
Cc: dri-devel@lists.freedesktop.org
Acked-by: Daniel Vetter 
Acked-by: Christian König 
Acked-by: Arnd Bergmann 
Acked-by: Sumit Semwal 
Acked-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 
---
v2: added lots of acks
added 2 more drivers that needed the change, as found by Arnd

 drivers/dma-buf/dma-buf.c | 34 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c   |  3 ++
 drivers/gpu/drm/armada/armada_gem.c   |  2 ++
 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/omapdrm/omap_gem_dmabuf.c |  2 ++
 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 +
 22 files changed, 64 insertions(+), 17 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 63d32261b63f..6c2b5ea828a6 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -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);