drm/amdgpu: fix the indexing issue during rlcg access ctrl init
authorShiwu Zhang <shiwu.zhang@amd.com>
Thu, 20 Jul 2023 07:25:15 +0000 (15:25 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jul 2023 17:47:26 +0000 (13:47 -0400)
commit9bc12db4e2f62fe257ce02a8d4aa20e9c47fbe0e
tree9036ec0a5ed6a405b36616eba8fa4a9516ed4b00
parent818c158fd4e43d07f29cb7eb1a6d0c06a881844f
drm/amdgpu: fix the indexing issue during rlcg access ctrl init

In case that the GET_INST() is used for looping, only loops for the
times of actual num of xcc, otherwise GET_INST() will return the invalid
index, a.k.a -1

And also remove the redundant mask checking in case of GET_INST()

Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c