diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 077d4cc51a8c..ebcb0835d52a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -1336,14 +1336,23 @@ static int amdgpu_suspend(struct amdgpu_device *adev) | |||
1336 | { | 1336 | { |
1337 | int i, r; | 1337 | int i, r; |
1338 | 1338 | ||
1339 | /* ungate SMC block first */ | ||
1340 | r = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_SMC, | ||
1341 | AMD_CG_STATE_UNGATE); | ||
1342 | if (r) { | ||
1343 | DRM_ERROR("set_clockgating_state(ungate) SMC failed %d\n",r); | ||
1344 | } | ||
1345 | |||
1339 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 1346 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
1340 | if (!adev->ip_block_status[i].valid) | 1347 | if (!adev->ip_block_status[i].valid) |
1341 | continue; | 1348 | continue; |
1342 | /* ungate blocks so that suspend can properly shut them down */ | 1349 | /* ungate blocks so that suspend can properly shut them down */ |
1343 | r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev, | 1350 | if (i != AMD_IP_BLOCK_TYPE_SMC) { |
1344 | AMD_CG_STATE_UNGATE); | 1351 | r = adev->ip_blocks[i].funcs->set_clockgating_state((void *)adev, |
1345 | if (r) { | 1352 | AMD_CG_STATE_UNGATE); |
1346 | DRM_ERROR("set_clockgating_state(ungate) %d failed %d\n", i, r); | 1353 | if (r) { |
1354 | DRM_ERROR("set_clockgating_state(ungate) %d failed %d\n", i, r); | ||
1355 | } | ||
1347 | } | 1356 | } |
1348 | /* XXX handle errors */ | 1357 | /* XXX handle errors */ |
1349 | r = adev->ip_blocks[i].funcs->suspend(adev); | 1358 | r = adev->ip_blocks[i].funcs->suspend(adev); |