]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amdgpu/pm/smu11: Fix fan set speed bug
authorArunpravin <Arunpravin.PaneerSelvam@amd.com>
Fri, 27 Nov 2020 16:10:24 +0000 (21:40 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Dec 2020 20:59:15 +0000 (15:59 -0500)
Fix fan set speed calculation.

Suggested-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c

index 62c34a01a3e1d19167a595044c7a0bf9c64adb54..624065d3c0797dc2737786f661c100912f973f30 100644 (file)
@@ -1187,7 +1187,12 @@ int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
        if (ret)
                return ret;
 
-       crystal_clock_freq = amdgpu_asic_get_xclk(adev);
+       /*
+        * crystal_clock_freq div by 4 is required since the fan control
+        * module refers to 25MHz
+        */
+
+       crystal_clock_freq = amdgpu_asic_get_xclk(adev) / 4;
        tach_period = 60 * crystal_clock_freq * 10000 / (8 * speed);
        WREG32_SOC15(THM, 0, mmCG_TACH_CTRL,
                     REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_TACH_CTRL),