aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2021-11-12 16:25:30 +0000
committerAlex Deucher <[email protected]>2021-12-27 17:16:34 +0000
commitdaf8de0874ab5b74b38a38726fdd3d07ef98a7ee (patch)
tree26d6a9cec0b96af8b1d466649aa7fa17a5af248d /drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
parentdrm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume (diff)
downloadkernel-daf8de0874ab5b74b38a38726fdd3d07ef98a7ee.tar.gz
kernel-daf8de0874ab5b74b38a38726fdd3d07ef98a7ee.zip
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 <[email protected]> Acked-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 73ac02372827..1a97b8b237d5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2154,7 +2154,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;
}