diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2023-06-01 14:48:08 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-14 10:35:26 +0200 |
commit | 35a9464e3402c26bfb847f127a78d4c38da95249 (patch) | |
tree | 76273b5c0246aebae144f9b1bbe7ac2223ba1c07 | |
parent | f1da7d7df5322020d696ceb5a81351df879709b4 (diff) | |
download | linux-stable-35a9464e3402c26bfb847f127a78d4c38da95249.tar.gz linux-stable-35a9464e3402c26bfb847f127a78d4c38da95249.tar.bz2 linux-stable-35a9464e3402c26bfb847f127a78d4c38da95249.zip |
drm/amdgpu: fix xclk freq on CHIP_STONEY
commit b447b079cf3a9971ea4d31301e673f49612ccc18 upstream.
According to Alex, most APUs from that time seem to have the same issue
(vbios says 48Mhz, actual is 100Mhz). I only have a CHIP_STONEY so I
limit the fixup to CHIP_STONEY
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vi.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 0327e0a6802b..dc061424f546 100644 --- a/drivers/gpu/drm/amd/amdgpu/vi.c +++ b/drivers/gpu/drm/amd/amdgpu/vi.c @@ -327,8 +327,15 @@ static u32 vi_get_xclk(struct amdgpu_device *adev) u32 reference_clock = adev->clock.spll.reference_freq; u32 tmp; - if (adev->flags & AMD_IS_APU) - return reference_clock; + if (adev->flags & AMD_IS_APU) { + switch (adev->asic_type) { + case CHIP_STONEY: + /* vbios says 48Mhz, but the actual freq is 100Mhz */ + return 10000; + default: + return reference_clock; + } + } tmp = RREG32_SMC(ixCG_CLKPIN_CNTL_2); if (REG_GET_FIELD(tmp, CG_CLKPIN_CNTL_2, MUX_TCLK_TO_XCLK)) |