On 12/19/25 14:41, Tvrtko Ursulin wrote:
> Struct amdgpu_ctx contains two copies of the pointer to the context
> manager. Remove one.
> 
> Signed-off-by: Tvrtko Ursulin <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 +--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 1 -
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index afedea02188d..41c05358d86d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -232,7 +232,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, 
> u32 hw_ip,
>       } else {
>               struct amdgpu_fpriv *fpriv;
>  
> -             fpriv = container_of(ctx->ctx_mgr, struct amdgpu_fpriv, 
> ctx_mgr);
> +             fpriv = container_of(ctx->mgr, struct amdgpu_fpriv, ctx_mgr);
>               r = amdgpu_xcp_select_scheds(adev, hw_ip, hw_prio, fpriv,
>                                               &num_scheds, &scheds);

Well that code is utterly nonsense to begin with. amdgpu_xcp_select_scheds() 
needs the xcp id to select from and not fpriv.

Can you look into re-structuring this so that we don't need that cast?

Thanks in advance,
Christian.


>               if (r)
> @@ -349,7 +349,6 @@ static int amdgpu_ctx_init(struct amdgpu_ctx_mgr *mgr, 
> int32_t priority,
>       else
>               ctx->stable_pstate = current_stable_pstate;
>  
> -     ctx->ctx_mgr = &(fpriv->ctx_mgr);
>       return 0;
>  }
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> index aed758d0acaa..cf8d700a22fe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h
> @@ -56,7 +56,6 @@ struct amdgpu_ctx {
>       unsigned long                   ras_counter_ce;
>       unsigned long                   ras_counter_ue;
>       struct amdgpu_ctx_mgr           *mgr;
> -     struct amdgpu_ctx_mgr           *ctx_mgr;
>       struct amdgpu_ctx_entity        
> *entities[AMDGPU_HW_IP_NUM][AMDGPU_MAX_ENTITY_NUM];
>  };
>  

Reply via email to