[PATCH 5.16 024/126] drm/amdgpu: fix a potential GPU hang on cyan skillfish

Greg Kroah-Hartman
2022-02-07T11:49:32Z

From: Lang Yu <Lang.Yu@amd.com>

commit bca52455a3c07922ee976714b00563a13a29ab15 upstream.

We observed a GPU hang when querying GMC CG state(i.e.,
cat amdgpu_pm_info) on cyan skillfish. Acctually, cyan
skillfish doesn't support any CG features.

Just prevent it from accessing GMC CG registers.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
@@ -1147,6 +1147,9 @@ static void gmc_v10_0_get_clockgating_st
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

+ if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 3))
+ return;
+
adev->mmhub.funcs->get_clockgating(adev, flags);

if (adev->ip_versions[ATHUB_HWIP][0] >= IP_VERSION(2, 1, 0))