提交 c5a93a28 编写于 作者: F Flora Cui 提交者: Alex Deucher

drm/amdgpu: ungate SMC clockgating first before suspend

46c34bcb6a15dd85329a39a5e72c62108626acdc put all block’s clockgating
support in SMC. The sequence in suspend routine should be adjusted
accordingly, otherwise it causes asic hang.
Signed-off-by: NFlora Cui <Flora.Cui@amd.com>
Reviewed-by: NEric Huang <JinHuiEric.Huang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 f4bfffdd
...@@ -1336,15 +1336,24 @@ static int amdgpu_suspend(struct amdgpu_device *adev) ...@@ -1336,15 +1336,24 @@ static int amdgpu_suspend(struct amdgpu_device *adev)
{ {
int i, r; int i, r;
/* ungate SMC block first */
r = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_SMC,
AMD_CG_STATE_UNGATE);
if (r) {
DRM_ERROR("set_clockgating_state(ungate) SMC failed %d\n",r);
}
for (i = adev->num_ip_blocks - 1; i >= 0; i--) { for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
if (!adev->ip_block_status[i].valid) if (!adev->ip_block_status[i].valid)
continue; continue;
/* ungate blocks so that suspend can properly shut them down */ /* ungate blocks so that suspend can properly shut them down */
if (i != AMD_IP_BLOCK_TYPE_SMC) {
r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev, r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev,
AMD_CG_STATE_UNGATE); AMD_CG_STATE_UNGATE);
if (r) { if (r) {
DRM_ERROR("set_clockgating_state(ungate) %d failed %d\n", i, r); DRM_ERROR("set_clockgating_state(ungate) %d failed %d\n", i, r);
} }
}
/* XXX handle errors */ /* XXX handle errors */
r = adev->ip_blocks[i].funcs->suspend(adev); r = adev->ip_blocks[i].funcs->suspend(adev);
/* XXX handle errors */ /* XXX handle errors */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册