drm/amd/powerplay: fix fan speed percent setting error on Fiji
authorEric Huang <JinHuiEric.Huang@amd.com>
Mon, 11 Apr 2016 18:28:55 +0000 (14:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:20:46 +0000 (20:20 -0400)
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c

index e2b448f4933428d483ecb279218bc953bc2c97c4..92976b68d6fd7b7a76c4d5f62b5b67cf4a871285 100644 (file)
@@ -221,8 +221,8 @@ int fiji_fan_ctrl_set_fan_speed_percent(struct pp_hwmgr *hwmgr,
        if (duty100 == 0)
                return -EINVAL;
 
-       tmp64 = (uint64_t)speed * 100;
-       do_div(tmp64, duty100);
+       tmp64 = (uint64_t)speed * duty100;
+       do_div(tmp64, 100);
        duty = (uint32_t)tmp64;
 
        PHM_WRITE_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,