[PATCH 3/3] drm/amdgpu: skip put fence if signal fails

Christian König ckoenig.leichtzumerken at gmail.com
Fri Jul 15 08:48:16 UTC 2022


Am 15.07.22 um 10:43 schrieb jiadong.zhu at amd.com:
> From: "Jiadong.Zhu" <Jiadong.Zhu at amd.com>
>
> Dma_fence_signal returning non-zero indicates
> that the fence is signaled and put somewhere else.
> Skip dma_fence_put to make the fence refcount correct.

Well quite a big NAK on this.

Reference counting should be completely independent where a fence signals.

Andrey can you take a look at this as well?

Thanks,
Christian.

>
> Signed-off-by: Jiadong.Zhu <Jiadong.Zhu at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index f4ed0785d523..93c1a5e83835 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -1500,8 +1500,8 @@ static void amdgpu_ib_preempt_signal_fences(struct dma_fence **fences,
>   		fence = fences[i];
>   		if (!fence)
>   			continue;
> -		dma_fence_signal(fence);
> -		dma_fence_put(fence);
> +		if (!dma_fence_signal(fence))
> +			dma_fence_put(fence);
>   	}
>   }
>   



More information about the amd-gfx mailing list