[PATCH] drm/amdgpu:fix race condition bug

Christian König deathsimple at vodafone.de
Fri Apr 7 11:26:21 UTC 2017


Am 07.04.2017 um 12:52 schrieb Monk Liu:
> Change-Id: Ib7a03f3cf5594deeb4ad333cc59b47a6bddfd1ad
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>

NAK, that is a not backward compatible change to the IOCTL interface.

And BTW what's the background of it?

Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 6d86eae..b8c11fe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -277,6 +277,9 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
>   
>   	spin_lock(&ctx->ring_lock);
>   
> +	if (!seq)
> +		seq = ctx->rings[ring->idx].sequence - 1;
> +
>   	if (seq >= cring->sequence) {
>   		spin_unlock(&ctx->ring_lock);
>   		return ERR_PTR(-EINVAL);




More information about the amd-gfx mailing list