[Lima] [PATCH] gpu: drm: remove redundant dma_fence_put() when drm_sched_job_add_dependency() fails

Andrey Grodzovsky andrey.grodzovsky at amd.com
Fri Apr 29 16:34:19 UTC 2022


Now it's easy to see it's redundant, it's a problematic design where the 
fence 'get' part is happening outside the job->dependencies array logic 
but the fence 'put' part is happening inside, leads to confusions such 
as adding this 'put'
in the first place. I will look into improving this if possible.

Patch is Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>

Andrey

On 2022-04-28 23:03, Hangyu Hua wrote:
> If fence is released in drm_sched_job_add_implicit_dependencies(), a 
> dangling pointer will be in obj->resv.
>
> specific scenario:
> recount = 1 init, obj->resv->fence_excl = fence
> recount = 1 before drm_sched_job_add_implicit_dependencies
> recount = 2 in [2]
> recount = 1 in [1]
> recount = 0 in [3] <--- fence release. But fence still in obj->resv
>
> Thanks,
> Hangyu 


More information about the lima mailing list