drm/amdgpu: Fix DEBUG_LOCKS_WARN_ON(depth <= 0) in amdgpu_ctx.lock
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix DEBUG_LOCKS_WARN_ON(depth <= 0) in amdgpu_ctx.lock
If CS is submitted using guilty ctx, we terminate amdgpu_cs_parser_init before locking ctx->lock, latter in amdgpu_cs_parser_fini we still are trying to release the lock just becase parser->ctx != NULL.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -2
@@ -125,14 +125,14 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs goto free_chunk; } +mutex_lock (&p->ctx->lock); +/* skip guilty context job */ if (atomic_read (&p->ctx->guilty) ==1 ) { ret = -ECANCELED ; goto free_chunk; } -mutex_lock (&p->ctx->lock); -/* get chunks */ chunk_array_user =u64_to_user_ptr (cs->in.chunks); if (copy_from_user(chunk_array, chunk_array_user,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1544129740-489-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org
Christian König
Reviewed-byAm 06.12.18 um 21:55 schrieb Andrey Grodzovsky:
Quoted 5 lines
If CS is submitted using guilty ctx, we terminate
amdgpu_cs_parser_initbefore lockingctx->lock, latter inamdgpu_cs_parser_finiwe still are trying to release the lock just becaseparser->ctx!= NULL.Signed-off-by Andrey Grodzovsky <[email protected]>
Quoted 15 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-0@@ -125,14 +125,14 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs goto free_chunk; } +mutex_lock (&p->ctx->lock); +/* skip guilty context job */
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, union drm_amdgpu_cs · line 138
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-2if (atomic_read (&p->ctx->guilty) ==1 ) { ret = -ECANCELED ; goto free_chunk; } -mutex_lock (&p->ctx->lock); -/* get chunks */ chunk_array_user =u64_to_user_ptr (cs->in.chunks); if (copy_from_user(chunk_array, chunk_array_user,
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx