[PATCH] drm/amdgpu: always reset the asic in suspend (v2)

Quan, Evan Evan.Quan at amd.com
Tue Nov 16 02:36:17 UTC 2021


[AMD Official Use Only]

Acked-by: Evan Quan <evan.quan at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Saturday, November 13, 2021 12:26 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
> Subject: [PATCH] drm/amdgpu: always reset the asic in suspend (v2)
> 
> If the platform suspend happens to fail and the power rail
> is not turned off, the GPU will be in an unknown state on
> resume, so reset the asic so that it will be in a known
> good state on resume even if the platform suspend failed.
> 
> v2: handle s0ix
> 
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 1db76429a673..b4591f6e82dd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2165,7 +2165,10 @@ static int amdgpu_pmops_suspend(struct device
> *dev)
>  	adev->in_s3 = true;
>  	r = amdgpu_device_suspend(drm_dev, true);
>  	adev->in_s3 = false;
> -
> +	if (r)
> +		return r;
> +	if (!adev->in_s0ix)
> +		r = amdgpu_asic_reset(adev);
>  	return r;
>  }
> 
> --
> 2.31.1


More information about the amd-gfx mailing list