[PATCH] drm/amdgpu: Return -EINVAL when MMSCH init status incorrect

Chen, JingWen (Wayne) JingWen.Chen2 at amd.com
Tue Oct 10 03:29:53 UTC 2023


Reviewed-by: Jingwen Chen <Jingwen.Chen2 at amd.com>
-- 
Best Regards,
JingWen Chen

On 2023/10/8 18:06, Lin.Cao wrote:
> Return -EINVAL when MMSCH init fail which can be handle by function
> amdgpu_device_reset_sriov correctly.
> 
> Signed-off-by: Lin.Cao <lincao12 at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
> index ac614b869aaf..a3768aefb6b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
> @@ -518,8 +518,11 @@ static int jpeg_v4_0_start_sriov(struct amdgpu_device *adev)
>   			return -EBUSY;
>   		}
>   	}
> -	if (resp != expected && resp != MMSCH_VF_MAILBOX_RESP__INCOMPLETE && init_status != MMSCH_VF_ENGINE_STATUS__PASS)
> +	if (resp != expected && resp != MMSCH_VF_MAILBOX_RESP__INCOMPLETE
> +			&& init_status != MMSCH_VF_ENGINE_STATUS__PASS) {
>   		DRM_ERROR("MMSCH init status is incorrect! readback=0x%08x, header init status for jpeg: %x\n", resp, init_status);
> +		return -EINVAL;
> +	}
>   
>   	return 0;
>   



More information about the amd-gfx mailing list