drm/amdgpu: Skip access gfx11 golden registers under SRIOV
authorZhenGuo Yin <zhenguo.yin@amd.com>
Thu, 23 Nov 2023 08:47:33 +0000 (16:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Nov 2023 23:21:30 +0000 (18:21 -0500)
[Why]
Golden registers are PF-only registers on gfx11.
RLCG interface will return "out-of-range" under SRIOV VF.

[How]
Skip access gfx11 golden registers under SRIOV.

Reviewed-by: Horace Chen <horace.chen@amd.com>
Signed-off-by: ZhenGuo Yin <zhenguo.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

index 8ed4a6fb147a2afbe8b2611e7bdb25ccd756865e..288e926e5cd4313966b92ead7297f86709d50cc6 100644 (file)
@@ -293,6 +293,9 @@ static void gfx_v11_0_set_kiq_pm4_funcs(struct amdgpu_device *adev)
 
 static void gfx_v11_0_init_golden_registers(struct amdgpu_device *adev)
 {
+       if (amdgpu_sriov_vf(adev))
+               return;
+
        switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
        case IP_VERSION(11, 0, 1):
        case IP_VERSION(11, 0, 4):