Commit 2915e43a authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: fix error checking in amdgpu_read_mm_registers for soc21

Properly skip non-existent registers as well.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2442Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 0dcdf849
...@@ -291,8 +291,9 @@ static int soc21_read_register(struct amdgpu_device *adev, u32 se_num, ...@@ -291,8 +291,9 @@ static int soc21_read_register(struct amdgpu_device *adev, u32 se_num,
*value = 0; *value = 0;
for (i = 0; i < ARRAY_SIZE(soc21_allowed_read_registers); i++) { for (i = 0; i < ARRAY_SIZE(soc21_allowed_read_registers); i++) {
en = &soc21_allowed_read_registers[i]; en = &soc21_allowed_read_registers[i];
if (adev->reg_offset[en->hwip][en->inst] && if (!adev->reg_offset[en->hwip][en->inst])
reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg] continue;
else if (reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg]
+ en->reg_offset)) + en->reg_offset))
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment