drm/amd/powerplay: Fix a bug in fan control setting default mode for Tonga and Fiji.
authorEric Huang <JinHuiEric.Huang@amd.com>
Thu, 3 Dec 2015 20:13:46 +0000 (15:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Dec 2015 21:42:48 +0000 (16:42 -0500)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_thermal.c

index 1b2eaa9544b28587fb6316e5e1989b925ebd2f9d..def57d0675ed46d04b6e80b0c9f41815c10d3aa9 100644 (file)
@@ -141,7 +141,7 @@ int fiji_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
 */
 int fiji_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr)
 {
-       if (hwmgr->fan_ctrl_is_in_default_mode) {
+       if (!hwmgr->fan_ctrl_is_in_default_mode) {
                PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,
                                CG_FDO_CTRL2, FDO_PWM_MODE, hwmgr->fan_ctrl_default_mode);
                PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,
index a315507d9cd92697f8c17185675fd87f8f36afc7..5da758674a48bbfe377dc73e2801804a17f11725 100644 (file)
@@ -129,7 +129,7 @@ int tonga_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode)
 */
 int tonga_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr)
 {
-       if (hwmgr->fan_ctrl_is_in_default_mode) {
+       if (!hwmgr->fan_ctrl_is_in_default_mode) {
                PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_FDO_CTRL2, FDO_PWM_MODE, hwmgr->fan_ctrl_default_mode);
                PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_FDO_CTRL2, TMIN, hwmgr->tmin);
                hwmgr->fan_ctrl_is_in_default_mode = true;