Skip to content

Commit d61e1d1

Browse files
Prike Liangalexdeucher
authored andcommitted
drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume
In the S2idle suspend/resume phase the gfxoff is keeping functional so some IP blocks will be likely to reinitialize at gfxoff entry and that will result in failing to program GC registers.Therefore, let disallow gfxoff until AMDGPU IPs reinitialized completely. Signed-off-by: Prike Liang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 5.15.x
1 parent 809734c commit d61e1d1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,6 +3210,15 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
32103210
return r;
32113211
}
32123212
adev->ip_blocks[i].status.hw = true;
3213+
3214+
if (adev->in_s0ix && adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
3215+
/* disable gfxoff for IP resume. The gfxoff will be re-enabled in
3216+
* amdgpu_device_resume() after IP resume.
3217+
*/
3218+
amdgpu_gfx_off_ctrl(adev, false);
3219+
DRM_DEBUG("will disable gfxoff for re-initializing other blocks\n");
3220+
}
3221+
32133222
}
32143223

32153224
return 0;
@@ -4185,6 +4194,13 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
41854194
/* Make sure IB tests flushed */
41864195
flush_delayed_work(&adev->delayed_init_work);
41874196

4197+
if (adev->in_s0ix) {
4198+
/* re-enable gfxoff after IP resume. This re-enables gfxoff after
4199+
* it was disabled for IP resume in amdgpu_device_ip_resume_phase2().
4200+
*/
4201+
amdgpu_gfx_off_ctrl(adev, true);
4202+
DRM_DEBUG("will enable gfxoff for the mission mode\n");
4203+
}
41884204
if (fbcon)
41894205
drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, false);
41904206

0 commit comments

Comments
 (0)