Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()
@ 2020-07-21 10:16 Xin He
  2020-07-29  7:38 ` Muchun Song
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Xin He @ 2020-07-21 10:16 UTC (permalink / raw)
  To: daniel, airlied, kraxel, sumit.semwal
  Cc: linux-kernel, dri-devel, virtualization, linux-media,
	linaro-mm-sig, Qi Liu, Xin He, Muchun Song

From: Qi Liu <liuqi.16@bytedance.com>

We should put the reference count of the fence after calling
virtio_gpu_cmd_submit(). So add the missing dma_fence_put().

Fixes: 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
Co-developed-by: Xin He <hexin.op@bytedance.com>
Signed-off-by: Xin He <hexin.op@bytedance.com>
Signed-off-by: Qi Liu <liuqi.16@bytedance.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
---

changelog in v3:
1) Change the subject from "drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()" to 
   "drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()"
2) Rework the commit log

changelog in v2:
1) Add a change description 

 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 5df722072ba0..19c5bc01eb79 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -179,6 +179,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
 
 	virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
 			      vfpriv->ctx_id, buflist, out_fence);
+	dma_fence_put(&out_fence->f);
 	virtio_gpu_notify(vgdev);
 	return 0;
 
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()
  2020-07-21 10:16 [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl() Xin He
@ 2020-07-29  7:38 ` Muchun Song
  2020-08-07  3:00 ` 何鑫
  2020-08-07 11:57 ` Gerd Hoffmann
  2 siblings, 0 replies; 5+ messages in thread
From: Muchun Song @ 2020-07-29  7:38 UTC (permalink / raw)
  To: Xin He, daniel, airlied, kraxel, sumit.semwal, LKML, dri-devel,
	virtualization
  Cc: linux-media, linaro-mm-sig, Qi Liu

On Tue, Jul 21, 2020 at 6:17 PM Xin He <hexin.op@bytedance.com> wrote:
>
> From: Qi Liu <liuqi.16@bytedance.com>
>
> We should put the reference count of the fence after calling
> virtio_gpu_cmd_submit(). So add the missing dma_fence_put().
>
> Fixes: 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
> Co-developed-by: Xin He <hexin.op@bytedance.com>
> Signed-off-by: Xin He <hexin.op@bytedance.com>
> Signed-off-by: Qi Liu <liuqi.16@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>
> changelog in v3:
> 1) Change the subject from "drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()" to
>    "drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()"
> 2) Rework the commit log
>
> changelog in v2:
> 1) Add a change description
>
>  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> index 5df722072ba0..19c5bc01eb79 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> @@ -179,6 +179,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
>
>         virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
>                               vfpriv->ctx_id, buflist, out_fence);
> +       dma_fence_put(&out_fence->f);
>         virtio_gpu_notify(vgdev);
>         return 0;
>
> --
> 2.21.1 (Apple Git-122.3)
>

Ping guys. Any comments or suggestions?

-- 
Yours,
Muchun

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()
  2020-07-21 10:16 [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl() Xin He
  2020-07-29  7:38 ` Muchun Song
@ 2020-08-07  3:00 ` 何鑫
  2020-08-07  5:52   ` Greg KH
  2020-08-07 11:57 ` Gerd Hoffmann
  2 siblings, 1 reply; 5+ messages in thread
From: 何鑫 @ 2020-08-07  3:00 UTC (permalink / raw)
  To: Daniel Vetter, airlied, kraxel, Sumit Semwal
  Cc: linux-kernel, dri-devel, virtualization, linux-media, Qi Liu,
	Muchun Song, gregkh

Xin He <hexin.op@bytedance.com> 于2020年7月21日周二 下午6:17写道:
>
> From: Qi Liu <liuqi.16@bytedance.com>
>
> We should put the reference count of the fence after calling
> virtio_gpu_cmd_submit(). So add the missing dma_fence_put().
>
> Fixes: 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
> Co-developed-by: Xin He <hexin.op@bytedance.com>
> Signed-off-by: Xin He <hexin.op@bytedance.com>
> Signed-off-by: Qi Liu <liuqi.16@bytedance.com>
> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> ---
>
> changelog in v3:
> 1) Change the subject from "drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()" to
>    "drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()"
> 2) Rework the commit log
>
> changelog in v2:
> 1) Add a change description
>
>  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> index 5df722072ba0..19c5bc01eb79 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> @@ -179,6 +179,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
>
>         virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
>                               vfpriv->ctx_id, buflist, out_fence);
> +       dma_fence_put(&out_fence->f);
>         virtio_gpu_notify(vgdev);
>         return 0;
>
> --
> 2.21.1 (Apple Git-122.3)
>

cc Greg

--
Xin He

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()
  2020-08-07  3:00 ` 何鑫
@ 2020-08-07  5:52   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2020-08-07  5:52 UTC (permalink / raw)
  To: 何鑫
  Cc: Daniel Vetter, airlied, kraxel, Sumit Semwal, linux-kernel,
	dri-devel, virtualization, linux-media, Qi Liu, Muchun Song

On Fri, Aug 07, 2020 at 11:00:11AM +0800, 何鑫 wrote:
> Xin He <hexin.op@bytedance.com> 于2020年7月21日周二 下午6:17写道:
> >
> > From: Qi Liu <liuqi.16@bytedance.com>
> >
> > We should put the reference count of the fence after calling
> > virtio_gpu_cmd_submit(). So add the missing dma_fence_put().
> >
> > Fixes: 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
> > Co-developed-by: Xin He <hexin.op@bytedance.com>
> > Signed-off-by: Xin He <hexin.op@bytedance.com>
> > Signed-off-by: Qi Liu <liuqi.16@bytedance.com>
> > Reviewed-by: Muchun Song <songmuchun@bytedance.com>
> > ---
> >
> > changelog in v3:
> > 1) Change the subject from "drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()" to
> >    "drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()"
> > 2) Rework the commit log
> >
> > changelog in v2:
> > 1) Add a change description
> >
> >  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> > index 5df722072ba0..19c5bc01eb79 100644
> > --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> > +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> > @@ -179,6 +179,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
> >
> >         virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
> >                               vfpriv->ctx_id, buflist, out_fence);
> > +       dma_fence_put(&out_fence->f);
> >         virtio_gpu_notify(vgdev);
> >         return 0;
> >
> > --
> > 2.21.1 (Apple Git-122.3)
> >
> 
> cc Greg

Why?

$ ./scripts/get_maintainer.pl --file drivers/gpu/drm/virtio/virtgpu_ioctl.c
David Airlie <airlied@linux.ie> (maintainer:VIRTIO GPU DRIVER)
Gerd Hoffmann <kraxel@redhat.com> (maintainer:VIRTIO GPU DRIVER)
Daniel Vetter <daniel@ffwll.ch> (maintainer:DRM DRIVERS)
Sumit Semwal <sumit.semwal@linaro.org> (maintainer:DMA BUFFER SHARING FRAMEWORK)
"Christian König" <christian.koenig@amd.com> (maintainer:DMA BUFFER SHARING FRAMEWORK)
dri-devel@lists.freedesktop.org (open list:VIRTIO GPU DRIVER)
virtualization@lists.linux-foundation.org (open list:VIRTIO GPU DRIVER)
linux-kernel@vger.kernel.org (open list)
linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK)
linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()
  2020-07-21 10:16 [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl() Xin He
  2020-07-29  7:38 ` Muchun Song
  2020-08-07  3:00 ` 何鑫
@ 2020-08-07 11:57 ` Gerd Hoffmann
  2 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2020-08-07 11:57 UTC (permalink / raw)
  To: Xin He
  Cc: daniel, airlied, sumit.semwal, linux-kernel, dri-devel,
	virtualization, linux-media, linaro-mm-sig, Qi Liu, Muchun Song

On Tue, Jul 21, 2020 at 06:16:47PM +0800, Xin He wrote:
> From: Qi Liu <liuqi.16@bytedance.com>
> 
> We should put the reference count of the fence after calling
> virtio_gpu_cmd_submit(). So add the missing dma_fence_put().

>  	virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
>  			      vfpriv->ctx_id, buflist, out_fence);
> +	dma_fence_put(&out_fence->f);
>  	virtio_gpu_notify(vgdev);

Pushed to drm-misc-fixes.

thanks,
  Gerd


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 10:16 [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl() Xin He
2020-07-29  7:38 ` Muchun Song
2020-08-07  3:00 ` 何鑫
2020-08-07  5:52   ` Greg KH
2020-08-07 11:57 ` Gerd Hoffmann

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git