]> git.proxmox.com Git - mirror_ubuntu-impish-kernel.git/commitdiff
drm/amdgpu: always reset the asic in suspend (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 12 Nov 2021 16:25:30 +0000 (11:25 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 7 Mar 2022 17:39:06 +0000 (18:39 +0100)
BugLink: https://bugs.launchpad.net/bugs/1959627
[ Upstream commit daf8de0874ab5b74b38a38726fdd3d07ef98a7ee ]

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 <luben.tuikov@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index d56764ed361da2f8f22b0fd74cb25edfb6f16d66..05fbce7ebf5ad931ebb97a7e80eb26a8571a8331 100644 (file)
@@ -1473,7 +1473,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;
 }