Skip to content

Commit 494b42f

Browse files
yunxialigregkh
authored andcommitted
drm/amdgpu: add skip_hw_access checks for sriov
[ Upstream commit b3948ad ] Accessing registers via host is missing the check for skip_hw_access and the lockdep check that comes with it. Signed-off-by: Yunxiang Li <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2e91ea2 commit 494b42f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,9 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v
998998
return 0;
999999
}
10001000

1001+
if (amdgpu_device_skip_hw_access(adev))
1002+
return 0;
1003+
10011004
reg_access_ctrl = &adev->gfx.rlc.reg_access_ctrl[xcc_id];
10021005
scratch_reg0 = (void __iomem *)adev->rmmio + 4 * reg_access_ctrl->scratch_reg0;
10031006
scratch_reg1 = (void __iomem *)adev->rmmio + 4 * reg_access_ctrl->scratch_reg1;
@@ -1073,6 +1076,9 @@ void amdgpu_sriov_wreg(struct amdgpu_device *adev,
10731076
{
10741077
u32 rlcg_flag;
10751078

1079+
if (amdgpu_device_skip_hw_access(adev))
1080+
return;
1081+
10761082
if (!amdgpu_sriov_runtime(adev) &&
10771083
amdgpu_virt_get_rlcg_reg_access_flag(adev, acc_flags, hwip, true, &rlcg_flag)) {
10781084
amdgpu_virt_rlcg_reg_rw(adev, offset, value, rlcg_flag, xcc_id);
@@ -1090,6 +1096,9 @@ u32 amdgpu_sriov_rreg(struct amdgpu_device *adev,
10901096
{
10911097
u32 rlcg_flag;
10921098

1099+
if (amdgpu_device_skip_hw_access(adev))
1100+
return 0;
1101+
10931102
if (!amdgpu_sriov_runtime(adev) &&
10941103
amdgpu_virt_get_rlcg_reg_access_flag(adev, acc_flags, hwip, false, &rlcg_flag))
10951104
return amdgpu_virt_rlcg_reg_rw(adev, offset, 0, rlcg_flag, xcc_id);

0 commit comments

Comments
 (0)