Skip to content

Commit 0dee726

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: flush any delayed gfxoff on suspend entry
DCN 3.1.4 is reported to hang on s2idle entry if graphics activity is happening during entry. This is because GFXOFF was scheduled as delayed but RLC gets disabled in s2idle entry sequence which will hang GFX IP if not already in GFXOFF. To help this problem, flush any delayed work for GFXOFF early in s2idle entry sequence to ensure that it's off when RLC is changed. commit 4b31b92 ("drm/amdgpu: complete gfxoff allow signal during suspend without delay") modified power gating flow so that if called in s0ix that it ensured that GFXOFF wasn't put in work queue but instead processed immediately. This is dead code due to commit 10cb67e ("drm/amdgpu: skip CG/PG for gfx during S0ix") because GFXOFF will now not be explicitly called as part of the suspend entry code. Remove that dead code. Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Tim Huang <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 603b9a5 commit 0dee726

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4160,6 +4160,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
41604160
drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, true);
41614161

41624162
cancel_delayed_work_sync(&adev->delayed_init_work);
4163+
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
41634164

41644165
amdgpu_ras_suspend(adev);
41654166

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,8 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
700700

701701
if (adev->gfx.gfx_off_req_count == 0 &&
702702
!adev->gfx.gfx_off_state) {
703-
/* If going to s2idle, no need to wait */
704-
if (adev->in_s0ix) {
705-
if (!amdgpu_dpm_set_powergating_by_smu(adev,
706-
AMD_IP_BLOCK_TYPE_GFX, true))
707-
adev->gfx.gfx_off_state = true;
708-
} else {
709-
schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
703+
schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
710704
delay);
711-
}
712705
}
713706
} else {
714707
if (adev->gfx.gfx_off_req_count == 0) {

0 commit comments

Comments
 (0)