* [PATCH] drm/amdgpu: initialize reg_access_ctrl
@ 2022-01-29 14:53 trix
0 siblings, 0 replies; only message in thread
From: trix @ 2022-01-29 14:53 UTC (permalink / raw)
To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
nathan, ndesaulniers, PengJu.Zhou, candice.li, Hawking.Zhang,
john.clements, Jingwen.Chen2, bokun.zhang, victor.skvortsov,
bernard, lijo.lazar
Cc: amd-gfx, dri-devel, linux-kernel, llvm, Tom Rix
From: Tom Rix <trix@redhat.com>
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")
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 80c25176c9932..c137652189190 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -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;
--
2.26.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-29 14:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 14:53 [PATCH] drm/amdgpu: initialize reg_access_ctrl trix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome