]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu/soc21: fix xclk for APUs
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 16 Jan 2026 22:33:05 +0000 (17:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 28 Jan 2026 21:21:31 +0000 (16:21 -0500)
The reference clock is supposed to be 100Mhz, but it
appears to actually be slightly lower (99.81Mhz).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14451
Reviewed-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/soc21.c

index 2da733b45c21a7e087711a0d7f82fe5d2f2c6d14..d9cc649d81ad499ce3128f97fea8f91a0defe04e 100644 (file)
@@ -256,7 +256,13 @@ static u32 soc21_get_config_memsize(struct amdgpu_device *adev)
 
 static u32 soc21_get_xclk(struct amdgpu_device *adev)
 {
-       return adev->clock.spll.reference_freq;
+       u32 reference_clock = adev->clock.spll.reference_freq;
+
+       /* reference clock is actually 99.81 Mhz rather than 100 Mhz */
+       if ((adev->flags & AMD_IS_APU) && reference_clock == 10000)
+               return 9981;
+
+       return reference_clock;
 }