Re: [PATCH] drm/amdgpu: add entity error check in amdgpu_ctx_get_entity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 11, 2023 at 5:29 AM ZhenGuo Yin <zhenguo.yin@xxxxxxx> wrote:
>
> [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.
>
> Signed-off-by: ZhenGuo Yin <zhenguo.yin@xxxxxxx>

Looks correct to me.
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index e3d047663d61..077e010e29d4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -417,6 +417,7 @@ int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
>                           u32 ring, struct drm_sched_entity **entity)
>  {
>         int r;
> +       struct drm_sched_entity *ctx_entity;
>
>         if (hw_ip >= AMDGPU_HW_IP_NUM) {
>                 DRM_ERROR("unknown HW IP type: %d\n", hw_ip);
> @@ -440,7 +441,14 @@ int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
>                         return r;
>         }
>
> -       *entity = &ctx->entities[hw_ip][ring]->entity;
> +       ctx_entity = &ctx->entities[hw_ip][ring]->entity;
> +       r = drm_sched_entity_error(ctx_entity);
> +       if (r) {
> +               DRM_DEBUG("error entity %p\n", ctx_entity);
> +               return r;
> +       }
> +
> +       *entity = ctx_entity;
>         return 0;
>  }
>
> --
> 2.35.1
>




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux