From: Eric Huang Date: Mon, 11 Apr 2016 18:26:12 +0000 (-0400) Subject: drm/amd/powerplay: fix fan speed percent setting error on Polaris10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=51224389543ebd7307e09f0f46e5c5cac417d940;p=linux-beck.git drm/amd/powerplay: fix fan speed percent setting error on Polaris10 The logic was reversed. Signed-off-by: Eric Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_thermal.c index d2f553d61c3d..d39c89bbdab0 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_thermal.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_thermal.c @@ -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,