Skip to contentSkip to conversation

drm/amdgpu: initialize reg_access_ctrl

PATCH In review [email protected] 2 participants 2 messages Jan 29, 2022 – Jan 31, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: initialize reg_access_ctrl

From: Tom Rix <[email protected]>

clang build fails with
amdgpu_virt.c:878:51: error: variable 'reg_access_ctrl' is
uninitialized when used here

  ... + 4 * reg_access_ctrl->scratch_reg0;
            ^~~~~~~~~~~~~~~

The reg_access_ctrl ptr is never initialized, so
initialize once we know it is supported.

Fixes 5d447e296701 ("drm/amdgpu: add helper for rlcg indirect reg access")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -0
index 80c25176c9932..c137652189190 100644
@@ -875,6 +875,7 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v
 		return 0;
 	}
 
+	reg_access_ctrl = &adev->gfx.rlc.reg_access_ctrl;
 	scratch_reg0 = (void __iomem *)adev->rmmio + 4 * reg_access_ctrl->scratch_reg0;
 	scratch_reg1 = (void __iomem *)adev->rmmio + 4 * reg_access_ctrl->scratch_reg1;
 	scratch_reg2 = (void __iomem *)adev->rmmio + 4 * reg_access_ctrl->scratch_reg2;
Signature · 1 line
2.26.3