kernel/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
.. .. @@ -66,6 +66,7 @@ 66 66 { 67 67 struct fd f = fdget(fd); 68 68 struct amdgpu_fpriv *fpriv; 69 + struct amdgpu_ctx_mgr *mgr;69 70 struct amdgpu_ctx *ctx; 70 71 uint32_t id; 71 72 int r; .. .. @@ -79,8 +80,11 @@ 79 80 return r; 80 81 } 81 82 82 - idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id)83 + mgr = &fpriv->ctx_mgr;84 + mutex_lock(&mgr->lock);85 + idr_for_each_entry(&mgr->ctx_handles, ctx, id)83 86 amdgpu_ctx_priority_override(ctx, priority); 87 + mutex_unlock(&mgr->lock);84 88 85 89 fdput(f); 86 90 return 0;