On 6/22/2024 9:17 PM, Rajneesh Bhardwaj wrote:
> Under SRIOV environment, the compute partition mode is setup by the
> host driver so state machine cached copy might be different when doing
> the transition for the first time.
> 
> Signed-off-by: Rajneesh Bhardwaj <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
> index 2b99eed5ba19..c4a9669bceb0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
> @@ -228,7 +228,8 @@ int amdgpu_xcp_query_partition_mode(struct amdgpu_xcp_mgr 
> *xcp_mgr, u32 flags)
>       if (!(flags & AMDGPU_XCP_FL_LOCKED))
>               mutex_lock(&xcp_mgr->xcp_lock);
>       mode = xcp_mgr->funcs->query_partition_mode(xcp_mgr);
> -     if (xcp_mgr->mode != AMDGPU_XCP_MODE_TRANS && mode != xcp_mgr->mode)
> +     if (xcp_mgr->mode != AMDGPU_XCP_MODE_TRANS && mode != xcp_mgr->mode
> +         && !amdgpu_sriov_vf(xcp_mgr->adev))

This indicates a fundamental problem in host-guest mode and host is
doing a switch without guest's knowledge. This needs to be fixed
differently.

Thanks,
Lijo

>               dev_WARN(
>                       xcp_mgr->adev->dev,
>                       "Cached partition mode %d not matching with device mode 
> %d",

Reply via email to