[PATCH 1/3] drm/xe: Remove extra dma_fence_put on xe_sync_entry_add_deps failure

Dixit, Ashutosh ashutosh.dixit at intel.com
Tue Aug 20 18:52:23 UTC 2024


On Tue, 20 Aug 2024 02:02:28 -0700, Himal Prasad Ghimiray wrote:
>
> drm_sched_job_add_dependency() drops references even in case of error,
> no need for caller to call dma_fence_put.

OK, there's another reference taken in xe_sync_entry_parse() but that is
typically dropped via xe_sync_entry_cleanup().

Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>

>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_sync.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
> index ca826aeb41ea..a0675f57a398 100644
> --- a/drivers/gpu/drm/xe/xe_sync.c
> +++ b/drivers/gpu/drm/xe/xe_sync.c
> @@ -206,16 +206,9 @@ int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
>
>  int xe_sync_entry_add_deps(struct xe_sync_entry *sync, struct xe_sched_job *job)
>  {
> -	int err;
> -
> -	if (sync->fence) {
> -		err = drm_sched_job_add_dependency(&job->drm,
> -						   dma_fence_get(sync->fence));
> -		if (err) {
> -			dma_fence_put(sync->fence);
> -			return err;
> -		}
> -	}
> +	if (sync->fence)
> +		return  drm_sched_job_add_dependency(&job->drm,
> +						     dma_fence_get(sync->fence));
>
>	return 0;
>  }
> --
> 2.34.1
>


More information about the Intel-xe mailing list