aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorArindam Nath <arindam.nath@amd.com>2016-11-25 06:25:16 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-09 02:32:19 -0500
commitc2a51dd3138df107432fc2ff452cf43ee49a7dff (patch)
treec274ebdc8a19365680759be7cd93bdba40609bc3 /drivers/gpu/drm/amd/amdgpu
parent8e1b86f30bc1e3d213d269a74b3375a06ba8199f (diff)
drm/amd/amdgpu: enable GUI idle INT after enabling CGCG
commit dd31ae9ac933636c3712b7dd0f6152c1d71f81fe upstream. GUI idle interrupts should be enabled only after we have enabled coarse grain clock gating (CGCG). This prevents GFX engine generating idle interrupt even though CGCG is not completely enabled. Most of the time this goes un-noticed, but on some Stoney ASICs this results in GFX engine hang after system resumes from suspend. The issue is not particular to Stoney though and could have occured on any ASIC. The patch fixes this issue. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reported-by: Sunil Uttarwar <Sunil.Uttarwar1@amd.com> Signed-off-by: Arindam Nath <arindam.nath@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index bb97182dc749..2534b4989924 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -5891,29 +5891,24 @@ static void gfx_v8_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev
5891 adev->gfx.rlc.funcs->enter_safe_mode(adev); 5891 adev->gfx.rlc.funcs->enter_safe_mode(adev);
5892 5892
5893 if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGCG)) { 5893 if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGCG)) {
5894 /* 1 enable cntx_empty_int_enable/cntx_busy_int_enable/
5895 * Cmp_busy/GFX_Idle interrupts
5896 */
5897 gfx_v8_0_enable_gui_idle_interrupt(adev, true);
5898
5899 temp1 = data1 = RREG32(mmRLC_CGTT_MGCG_OVERRIDE); 5894 temp1 = data1 = RREG32(mmRLC_CGTT_MGCG_OVERRIDE);
5900 data1 &= ~RLC_CGTT_MGCG_OVERRIDE__CGCG_MASK; 5895 data1 &= ~RLC_CGTT_MGCG_OVERRIDE__CGCG_MASK;
5901 if (temp1 != data1) 5896 if (temp1 != data1)
5902 WREG32(mmRLC_CGTT_MGCG_OVERRIDE, data1); 5897 WREG32(mmRLC_CGTT_MGCG_OVERRIDE, data1);
5903 5898
5904 /* 2 wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */ 5899 /* : wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */
5905 gfx_v8_0_wait_for_rlc_serdes(adev); 5900 gfx_v8_0_wait_for_rlc_serdes(adev);
5906 5901
5907 /* 3 - clear cgcg override */ 5902 /* 2 - clear cgcg override */
5908 gfx_v8_0_send_serdes_cmd(adev, BPM_REG_CGCG_OVERRIDE, CLE_BPM_SERDES_CMD); 5903 gfx_v8_0_send_serdes_cmd(adev, BPM_REG_CGCG_OVERRIDE, CLE_BPM_SERDES_CMD);
5909 5904
5910 /* wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */ 5905 /* wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */
5911 gfx_v8_0_wait_for_rlc_serdes(adev); 5906 gfx_v8_0_wait_for_rlc_serdes(adev);
5912 5907
5913 /* 4 - write cmd to set CGLS */ 5908 /* 3 - write cmd to set CGLS */
5914 gfx_v8_0_send_serdes_cmd(adev, BPM_REG_CGLS_EN, SET_BPM_SERDES_CMD); 5909 gfx_v8_0_send_serdes_cmd(adev, BPM_REG_CGLS_EN, SET_BPM_SERDES_CMD);
5915 5910
5916 /* 5 - enable cgcg */ 5911 /* 4 - enable cgcg */
5917 data |= RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK; 5912 data |= RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK;
5918 5913
5919 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) { 5914 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) {
@@ -5931,6 +5926,11 @@ static void gfx_v8_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev
5931 5926
5932 if (temp != data) 5927 if (temp != data)
5933 WREG32(mmRLC_CGCG_CGLS_CTRL, data); 5928 WREG32(mmRLC_CGCG_CGLS_CTRL, data);
5929
5930 /* 5 enable cntx_empty_int_enable/cntx_busy_int_enable/
5931 * Cmp_busy/GFX_Idle interrupts
5932 */
5933 gfx_v8_0_enable_gui_idle_interrupt(adev, true);
5934 } else { 5934 } else {
5935 /* disable cntx_empty_int_enable & GFX Idle interrupt */ 5935 /* disable cntx_empty_int_enable & GFX Idle interrupt */
5936 gfx_v8_0_enable_gui_idle_interrupt(adev, false); 5936 gfx_v8_0_enable_gui_idle_interrupt(adev, false);