dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: fixup ttm_bo_add_move_fence
@ 2022-04-13  8:21 Matthew Auld
  2022-04-13  8:43 ` Christian König
  2022-04-13  8:44 ` Daniel Vetter
  0 siblings, 2 replies; 5+ messages in thread
From: Matthew Auld @ 2022-04-13  8:21 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Christian König, dri-devel

It looks like we still need to call dma_fence_put() on the man->move,
otherwise we just end up leaking it, leading to fireworks later.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5689
Fixes: 8bb31587820a ("drm/ttm: remove bo->moving")
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 015a94f766de..b15b77e10383 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -744,6 +744,8 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
 		dma_fence_put(fence);
 		return ret;
 	}
+
+	dma_fence_put(fence);
 	return 0;
 }
 
-- 
2.34.1


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

* Re: [PATCH] drm/ttm: fixup ttm_bo_add_move_fence
  2022-04-13  8:21 [PATCH] drm/ttm: fixup ttm_bo_add_move_fence Matthew Auld
@ 2022-04-13  8:43 ` Christian König
  2022-04-13  8:45   ` Daniel Vetter
  2022-04-13  8:44 ` Daniel Vetter
  1 sibling, 1 reply; 5+ messages in thread
From: Christian König @ 2022-04-13  8:43 UTC (permalink / raw)
  To: Matthew Auld, intel-gfx; +Cc: Daniel Vetter, dri-devel

Am 13.04.22 um 10:21 schrieb Matthew Auld:
> It looks like we still need to call dma_fence_put() on the man->move,
> otherwise we just end up leaking it, leading to fireworks later.
>
> Closes: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Fintel%2F-%2Fissues%2F5689&amp;data=04%7C01%7Cchristian.koenig%40amd.com%7C2c316b01285b4deacfda08da1d26a778%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637854349105267939%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=bWuQuQm6N5Lf183uo%2BsEw%2FxMWQFYVkyfYnB6SH61fto%3D&amp;reserved=0
> Fixes: 8bb31587820a ("drm/ttm: remove bo->moving")
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>

Ah, yes! Previously we added the fence reference to bo->moving. I was 
already searching for that one as well.

Reviewed-by: Christian König <christian.koenig@amd.com>

Going to push it to drm-misc-next in a minute.

Thanks,
Christian.

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 015a94f766de..b15b77e10383 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -744,6 +744,8 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
>   		dma_fence_put(fence);
>   		return ret;
>   	}
> +
> +	dma_fence_put(fence);
>   	return 0;
>   }
>   


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

* Re: [PATCH] drm/ttm: fixup ttm_bo_add_move_fence
  2022-04-13  8:21 [PATCH] drm/ttm: fixup ttm_bo_add_move_fence Matthew Auld
  2022-04-13  8:43 ` Christian König
@ 2022-04-13  8:44 ` Daniel Vetter
  2022-04-13  9:07   ` Christian König
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2022-04-13  8:44 UTC (permalink / raw)
  To: Matthew Auld; +Cc: Daniel Vetter, intel-gfx, Christian König, dri-devel

On Wed, Apr 13, 2022 at 09:21:33AM +0100, Matthew Auld wrote:
> It looks like we still need to call dma_fence_put() on the man->move,
> otherwise we just end up leaking it, leading to fireworks later.
> 
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5689
> Fixes: 8bb31587820a ("drm/ttm: remove bo->moving")
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 015a94f766de..b15b77e10383 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -744,6 +744,8 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
>  		dma_fence_put(fence);
>  		return ret;
>  	}
> +
> +	dma_fence_put(fence);

Please delete the above if () and simplify the function tail to

	dma_fence_put(fence);
	return ret;

With that Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

And thanks a lot for catching this, I guess I get a prize for most useless
review ever :-/ Hopefully this one here is better.
-Daniel


>  	return 0;
>  }
>  
> -- 
> 2.34.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm/ttm: fixup ttm_bo_add_move_fence
  2022-04-13  8:43 ` Christian König
@ 2022-04-13  8:45   ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2022-04-13  8:45 UTC (permalink / raw)
  To: Christian König; +Cc: Daniel Vetter, intel-gfx, Matthew Auld, dri-devel

On Wed, Apr 13, 2022 at 10:43:02AM +0200, Christian König wrote:
> Am 13.04.22 um 10:21 schrieb Matthew Auld:
> > It looks like we still need to call dma_fence_put() on the man->move,
> > otherwise we just end up leaking it, leading to fireworks later.
> > 
> > Closes: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Fintel%2F-%2Fissues%2F5689&amp;data=04%7C01%7Cchristian.koenig%40amd.com%7C2c316b01285b4deacfda08da1d26a778%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637854349105267939%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=bWuQuQm6N5Lf183uo%2BsEw%2FxMWQFYVkyfYnB6SH61fto%3D&amp;reserved=0
> > Fixes: 8bb31587820a ("drm/ttm: remove bo->moving")
> > Cc: Christian König <christian.koenig@amd.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> 
> Ah, yes! Previously we added the fence reference to bo->moving. I was
> already searching for that one as well.
> 
> Reviewed-by: Christian König <christian.koenig@amd.com>
> 
> Going to push it to drm-misc-next in a minute.

If you haven't pushed yet, pls also check my bikeshed, the code looks a
bit funny with this patch applied :-)
-Daniel

> 
> Thanks,
> Christian.
> 
> > ---
> >   drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> > index 015a94f766de..b15b77e10383 100644
> > --- a/drivers/gpu/drm/ttm/ttm_bo.c
> > +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> > @@ -744,6 +744,8 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
> >   		dma_fence_put(fence);
> >   		return ret;
> >   	}
> > +
> > +	dma_fence_put(fence);
> >   	return 0;
> >   }
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm/ttm: fixup ttm_bo_add_move_fence
  2022-04-13  8:44 ` Daniel Vetter
@ 2022-04-13  9:07   ` Christian König
  0 siblings, 0 replies; 5+ messages in thread
From: Christian König @ 2022-04-13  9:07 UTC (permalink / raw)
  To: Daniel Vetter, Matthew Auld; +Cc: Daniel Vetter, intel-gfx, dri-devel



Am 13.04.22 um 10:44 schrieb Daniel Vetter:
> On Wed, Apr 13, 2022 at 09:21:33AM +0100, Matthew Auld wrote:
>> It looks like we still need to call dma_fence_put() on the man->move,
>> otherwise we just end up leaking it, leading to fireworks later.
>>
>> Closes: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Fintel%2F-%2Fissues%2F5689&amp;data=04%7C01%7Cchristian.koenig%40amd.com%7C989e8d698f6d4f0b37c508da1d29dfb4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637854363041323745%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=8lxdsjPRiu%2Ft8O4kEHQEKtrMFd7gJbbFz25mYMRk3Ig%3D&amp;reserved=0
>> Fixes: 8bb31587820a ("drm/ttm: remove bo->moving")
>> Cc: Christian König <christian.koenig@amd.com>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> ---
>>   drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
>> index 015a94f766de..b15b77e10383 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
>> @@ -744,6 +744,8 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
>>   		dma_fence_put(fence);
>>   		return ret;
>>   	}
>> +
>> +	dma_fence_put(fence);
> Please delete the above if () and simplify the function tail to
>
> 	dma_fence_put(fence);
> 	return ret;
>
> With that Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> And thanks a lot for catching this, I guess I get a prize for most useless
> review ever :-/ Hopefully this one here is better.

Well so far we one inversion of min/max, one missing put and the 
incorrect handling of the return code in i915.

Considering how complex the patches have been I think we are still 
pretty good.

Christian.

> -Daniel
>
>
>>   	return 0;
>>   }
>>   
>> -- 
>> 2.34.1
>>


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

end of thread, other threads:[~2022-04-13  9:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13  8:21 [PATCH] drm/ttm: fixup ttm_bo_add_move_fence Matthew Auld
2022-04-13  8:43 ` Christian König
2022-04-13  8:45   ` Daniel Vetter
2022-04-13  8:44 ` Daniel Vetter
2022-04-13  9:07   ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).