drm/amd/powerplay: fix fan speed percent setting error on Polaris10
authorEric Huang <JinHuiEric.Huang@amd.com>
Mon, 11 Apr 2016 18:26:12 +0000 (14:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:29:43 +0000 (20:29 -0400)
The logic was reversed.

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/polaris10_thermal.c

index d2f553d61c3d416699ec30b4f4597759b43085c1..d39c89bbdab045a6c0f06a78cd911924fcfd44e5 100644 (file)
@@ -220,8 +220,8 @@ int polaris10_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,