| From 1846a81c15d2579eb9fe5ec7c02df458919814f4 Mon Sep 17 00:00:00 2001 |
| From: Alex Deucher <alexander.deucher@amd.com> |
| Date: Wed, 12 Feb 2020 01:46:16 -0500 |
| Subject: [PATCH] drm/amdgpu/soc15: fix xclk for raven |
| |
| commit c657b936ea98630ef5ba4f130ab1ad5c534d0165 upstream. |
| |
| It's 25 Mhz (refclk / 4). This fixes the interpretation |
| of the rlc clock counter. |
| |
| Acked-by: Evan Quan <evan.quan@amd.com> |
| Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
| Cc: stable@vger.kernel.org |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c |
| index 84c34712e39e..9b0f1871b71d 100644 |
| --- a/drivers/gpu/drm/amd/amdgpu/soc15.c |
| +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c |
| @@ -217,7 +217,12 @@ static u32 soc15_get_config_memsize(struct amdgpu_device *adev) |
| |
| static u32 soc15_get_xclk(struct amdgpu_device *adev) |
| { |
| - return adev->clock.spll.reference_freq; |
| + u32 reference_clock = adev->clock.spll.reference_freq; |
| + |
| + if (adev->asic_type == CHIP_RAVEN) |
| + return reference_clock / 4; |
| + |
| + return reference_clock; |
| } |
| |
| |
| -- |
| 2.7.4 |
| |