drm/amd/pp: Fix fan's RPM setting not work on VI/Vega10
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 20 Sep 2018 07:11:08 +0000 (15:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:00:18 +0000 (17:00 -0500)
set the target rpm value to wrong register.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c

index 44527755e747f1bf232664e8a69a4ec7e9f0a71a..eef086c5afb6a3d3c291cd095337a5ef72ddd185 100644 (file)
@@ -272,7 +272,7 @@ int smu7_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)
        tach_period = 60 * crystal_clock_freq * 10000 / (8 * speed);
 
        PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,
-                               CG_TACH_STATUS, TACH_PERIOD, tach_period);
+                               CG_TACH_CTRL, TARGET_PERIOD, tach_period);
 
        return smu7_fan_ctrl_set_static_mode(hwmgr, FDO_PWM_MODE_STATIC_RPM);
 }
index 407762b36901cb5dc21404c3c5d75e85a355692f..538de6cfa23fdcd20c422444bb96800680f9a706 100644 (file)
@@ -322,9 +322,9 @@ int vega10_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed)
        if (!result) {
                crystal_clock_freq = amdgpu_asic_get_xclk((struct amdgpu_device *)hwmgr->adev);
                tach_period = 60 * crystal_clock_freq * 10000 / (8 * speed);
-               WREG32_SOC15(THM, 0, mmCG_TACH_STATUS,
-                               REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_TACH_STATUS),
-                                       CG_TACH_STATUS, TACH_PERIOD,
+               WREG32_SOC15(THM, 0, mmCG_TACH_CTRL,
+                               REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_TACH_CTRL),
+                                       CG_TACH_CTRL, TARGET_PERIOD,
                                        tach_period));
        }
        return vega10_fan_ctrl_set_static_mode(hwmgr, FDO_PWM_MODE_STATIC_RPM);