aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2018-06-01 02:41:04 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-06-13 14:45:21 -0400
commit06b18f61ee78f8c69417c3a5e4f21ed678662315 (patch)
tree03798c38b14c361d3f2bf2c9d8cbef50fc23bd5f
parent387f49e5467244b7bcb4cad0946a5d0fcade5f92 (diff)
drm/amdgpu: fix CG enabling hang with gfxoff enabled
After defer the execution of clockgating enabling, at that time, gfx already enter into "off" state. Howerver, clockgating enabling will use MMIO to access the gfx registers, then get the gfx hung. So here we should move the gfx powergating and gfxoff enabling behavior at the end of initialization behind clockgating. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Cc: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c12
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c5
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c4
4 files changed, 15 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 290e279abf0d..3317d1536f4f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1730,6 +1730,18 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)
1730 } 1730 }
1731 } 1731 }
1732 } 1732 }
1733
1734 if (adev->powerplay.pp_feature & PP_GFXOFF_MASK) {
1735 /* enable gfx powergating */
1736 amdgpu_device_ip_set_powergating_state(adev,
1737 AMD_IP_BLOCK_TYPE_GFX,
1738 AMD_PG_STATE_GATE);
1739 /* enable gfxoff */
1740 amdgpu_device_ip_set_powergating_state(adev,
1741 AMD_IP_BLOCK_TYPE_SMC,
1742 AMD_PG_STATE_GATE);
1743 }
1744
1733 return 0; 1745 return 0;
1734} 1746}
1735 1747
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 4f7a72dd3734..95f2773dc11d 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3405,11 +3405,6 @@ static int gfx_v9_0_late_init(void *handle)
3405 if (r) 3405 if (r)
3406 return r; 3406 return r;
3407 3407
3408 r = amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_GFX,
3409 AMD_PG_STATE_GATE);
3410 if (r)
3411 return r;
3412
3413 return 0; 3408 return 0;
3414} 3409}
3415 3410
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index b493369e6d0f..d0e6e2dd6bc6 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -245,7 +245,7 @@ static int pp_set_powergating_state(void *handle,
245 } 245 }
246 246
247 if (hwmgr->hwmgr_func->enable_per_cu_power_gating == NULL) { 247 if (hwmgr->hwmgr_func->enable_per_cu_power_gating == NULL) {
248 pr_info("%s was not implemented.\n", __func__); 248 pr_debug("%s was not implemented.\n", __func__);
249 return 0; 249 return 0;
250 } 250 }
251 251
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
index 6a6367190bed..d4bc83e81389 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
@@ -313,7 +313,7 @@ static int smu10_disable_gfx_off(struct pp_hwmgr *hwmgr)
313 313
314static int smu10_disable_dpm_tasks(struct pp_hwmgr *hwmgr) 314static int smu10_disable_dpm_tasks(struct pp_hwmgr *hwmgr)
315{ 315{
316 return smu10_disable_gfx_off(hwmgr); 316 return 0;
317} 317}
318 318
319static int smu10_enable_gfx_off(struct pp_hwmgr *hwmgr) 319static int smu10_enable_gfx_off(struct pp_hwmgr *hwmgr)
@@ -328,7 +328,7 @@ static int smu10_enable_gfx_off(struct pp_hwmgr *hwmgr)
328 328
329static int smu10_enable_dpm_tasks(struct pp_hwmgr *hwmgr) 329static int smu10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
330{ 330{
331 return smu10_enable_gfx_off(hwmgr); 331 return 0;
332} 332}
333 333
334static int smu10_gfx_off_control(struct pp_hwmgr *hwmgr, bool enable) 334static int smu10_gfx_off_control(struct pp_hwmgr *hwmgr, bool enable)