Commit d68cf992 authored by Gavin Wan's avatar Gavin Wan Committed by Alex Deucher
Browse files

drm/amd/amdgpu: Remove static from variable in RLCG Reg RW



[why]
These static variables save the RLC Scratch registers address.
When we install multiple GPUs (for example: XGMI setting) and
multiple GPUs call the function at same time. The RLC Scratch
registers address are changed each other. Then it caused
reading/writing from/to wrong GPU.

[how]
Removed the static from the variables. The variables are
on the stack.

Fixes: 5d447e29 ("drm/amdgpu: add helper for rlcg indirect reg access")
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarGavin Wan <Gavin.Wan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 250e64a3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -870,11 +870,11 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v
	uint32_t timeout = 50000;
	uint32_t i, tmp;
	uint32_t ret = 0;
	static void *scratch_reg0;
	static void *scratch_reg1;
	static void *scratch_reg2;
	static void *scratch_reg3;
	static void *spare_int;
	void *scratch_reg0;
	void *scratch_reg1;
	void *scratch_reg2;
	void *scratch_reg3;
	void *spare_int;

	if (!adev->gfx.rlc.rlcg_reg_access_supported) {
		dev_err(adev->dev,