drm/amdgpu: Remove duplicated "context still alive" check
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Mon, 19 May 2025 16:37:12 +0000 (17:37 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 May 2025 16:02:25 +0000 (12:02 -0400)
When amdgpu_ctx_mgr_fini() calls amdgpu_ctx_mgr_entity_fini() it contains
the exact same "context still alive" check as it will do next. Remove the
duplicated copy.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

index 4ff8552e872db1f7699ce73cd8a83e5bb0985b56..85567d0d9545cf514a66560f333080ceb36c45d7 100644 (file)
@@ -949,19 +949,7 @@ static void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
 
 void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr)
 {
-       struct amdgpu_ctx *ctx;
-       struct idr *idp;
-       uint32_t id;
-
        amdgpu_ctx_mgr_entity_fini(mgr);
-
-       idp = &mgr->ctx_handles;
-
-       idr_for_each_entry(idp, ctx, id) {
-               if (kref_put(&ctx->refcount, amdgpu_ctx_fini) != 1)
-                       DRM_ERROR("ctx %p is still alive\n", ctx);
-       }
-
        idr_destroy(&mgr->ctx_handles);
        mutex_destroy(&mgr->lock);
 }