Skip to contentSkip to conversation

drm/amdgpu: Skip access GRBM_CNTL under SRIOV on gfx_v11

PATCH In review Yifan Zha 2 participants 2 messages Oct 25, 2022

Subsystems (2)
lore
Share & tools
lore

Yifan Zha

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Skip access GRBM_CNTL under SRIOV on gfx_v11

[Why]
GRBM_CNTL is a PF_only register on gfx_v11.
RLCG interface will return "out of range" under SRIOV VF.

[How]
Skip access GRBM_CNTL under gfx_v11 SRIOV VF.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -1
index e3842dc100d6..1330768df0b1 100644
@@ -1626,7 +1626,8 @@ static void gfx_v11_0_constants_init(struct amdgpu_device *adev)
 	u32 tmp;
 	int i;
 
-	WREG32_FIELD15_PREREG(GC, 0, GRBM_CNTL, READ_TIMEOUT, 0xff);
+	if (!amdgpu_sriov_vf(adev))
+		WREG32_FIELD15_PREREG(GC, 0, GRBM_CNTL, READ_TIMEOUT, 0xff);
 
 	gfx_v11_0_setup_rb(adev);
 	gfx_v11_0_get_cu_info(adev, &adev->gfx.cu_info);
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Yifan Zha

[Why]
GRBM_CNTL is a PF_only register on gfx_v11.
RLCG interface will return "out of range" under SRIOV VF.

[How]
Skip access GRBM_CNTL under gfx_v11 SRIOV VF.

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -2
index e3842dc100d6..1330768df0b1 100644
@@ -1626,7 +1626,8 @@ static void gfx_v11_0_constants_init(struct amdgpu_device *adev)
        u32 tmp;
        int i;
 
-       WREG32_FIELD15_PREREG(GC, 0, GRBM_CNTL, READ_TIMEOUT, 0xff);
+       if (!amdgpu_sriov_vf(adev))
+               WREG32_FIELD15_PREREG(GC, 0, GRBM_CNTL, READ_TIMEOUT, 0xff);
 
        gfx_v11_0_setup_rb(adev);
        gfx_v11_0_get_cu_info(adev, &adev->gfx.cu_info);
--

2.25.1