From: Alex Deucher Date: Fri, 12 Nov 2021 16:25:30 +0000 (-0500) Subject: drm/amdgpu: always reset the asic in suspend (v2) X-Git-Tag: v6.6.17~8346^2~7^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6dc8265f9803ccb7e5da804e01601f0c14f270e0;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Luben Tuikov Acked-by: Evan Quan Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 739e4d9..405b0d5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2170,7 +2170,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; }