Skip to content

Commit 71eaac3

Browse files
ZhenGuo Yinalexdeucher
authored andcommitted
drm/amdgpu: add entity error check in amdgpu_ctx_get_entity
[Why] UMD is not aware of entity error, and will keep submitting jobs into the error entity. [How] Add entity error check when getting entity from ctx. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: ZhenGuo Yin <zhenguo.yin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f88e295 commit 71eaac3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
432432
u32 ring, struct drm_sched_entity **entity)
433433
{
434434
int r;
435+
struct drm_sched_entity *ctx_entity;
435436

436437
if (hw_ip >= AMDGPU_HW_IP_NUM) {
437438
DRM_ERROR("unknown HW IP type: %d\n", hw_ip);
@@ -455,7 +456,14 @@ int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
455456
return r;
456457
}
457458

458-
*entity = &ctx->entities[hw_ip][ring]->entity;
459+
ctx_entity = &ctx->entities[hw_ip][ring]->entity;
460+
r = drm_sched_entity_error(ctx_entity);
461+
if (r) {
462+
DRM_DEBUG("error entity %p\n", ctx_entity);
463+
return r;
464+
}
465+
466+
*entity = ctx_entity;
459467
return 0;
460468
}
461469

0 commit comments

Comments
 (0)