Skip to content

Commit 986a89b

Browse files
Prike Lianggregkh
authored andcommitted
drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume
commit d61e1d1 upstream. 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 Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a2f0934 commit 986a89b

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
@@ -3185,6 +3185,15 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
31853185
return r;
31863186
}
31873187
adev->ip_blocks[i].status.hw = true;
3188+
3189+
if (adev->in_s0ix && adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
3190+
/* disable gfxoff for IP resume. The gfxoff will be re-enabled in
3191+
* amdgpu_device_resume() after IP resume.
3192+
*/
3193+
amdgpu_gfx_off_ctrl(adev, false);
3194+
DRM_DEBUG("will disable gfxoff for re-initializing other blocks\n");
3195+
}
3196+
31883197
}
31893198

31903199
return 0;
@@ -4114,6 +4123,13 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
41144123
/* Make sure IB tests flushed */
41154124
flush_delayed_work(&adev->delayed_init_work);
41164125

4126+
if (adev->in_s0ix) {
4127+
/* re-enable gfxoff after IP resume. This re-enables gfxoff after
4128+
* it was disabled for IP resume in amdgpu_device_ip_resume_phase2().
4129+
*/
4130+
amdgpu_gfx_off_ctrl(adev, true);
4131+
DRM_DEBUG("will enable gfxoff for the mission mode\n");
4132+
}
41174133
if (fbcon)
41184134
amdgpu_fbdev_set_suspend(adev, 0);
41194135

0 commit comments

Comments
 (0)