Skip to content

Commit 3f719cf

Browse files
Prike Liangalexdeucher
authored andcommitted
drm/amdgpu: reset gpu for s3 suspend abort case
In the s3 suspend abort case some type of gfx9 power rail not turn off from FCH side and this will put the GPU in an unknown power status, so let's reset the gpu to a known good power state before reinitialize gpu device. Signed-off-by: Prike Liang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0326de4 commit 3f719cf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/gpu/drm/amd/amdgpu/soc15.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,10 +1298,32 @@ static int soc15_common_suspend(void *handle)
12981298
return soc15_common_hw_fini(adev);
12991299
}
13001300

1301+
static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
1302+
{
1303+
u32 sol_reg;
1304+
1305+
sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
1306+
1307+
/* Will reset for the following suspend abort cases.
1308+
* 1) Only reset limit on APU side, dGPU hasn't checked yet.
1309+
* 2) S3 suspend abort and TOS already launched.
1310+
*/
1311+
if (adev->flags & AMD_IS_APU && adev->in_s3 &&
1312+
!adev->suspend_complete &&
1313+
sol_reg)
1314+
return true;
1315+
1316+
return false;
1317+
}
1318+
13011319
static int soc15_common_resume(void *handle)
13021320
{
13031321
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
13041322

1323+
if (soc15_need_reset_on_resume(adev)) {
1324+
dev_info(adev->dev, "S3 suspend abort case, let's reset ASIC.\n");
1325+
soc15_asic_reset(adev);
1326+
}
13051327
return soc15_common_hw_init(adev);
13061328
}
13071329

0 commit comments

Comments
 (0)