drm/amdgpu: Add lock around VF RLCG interface
authorVictor Skvortsov <victor.skvortsov@amd.com>
Mon, 27 May 2024 20:10:43 +0000 (16:10 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 May 2024 18:48:30 +0000 (14:48 -0400)
commite864180ee49b4d30e640fd1e1d852b86411420c9
tree926ce4d37f5c49abc0f81d99a8f99d9be7c4efc9
parent7978c4d41496becda1c1cbd5b783c60e9b64d618
drm/amdgpu: Add lock around VF RLCG interface

flush_gpu_tlb may be called from another thread while
device_gpu_recover is running.

Both of these threads access registers through the VF
RLCG interface during VF Full Access. Add a lock around this interface
to prevent race conditions between these threads.

Signed-off-by: Victor Skvortsov <victor.skvortsov@amd.com>
Reviewed-by: Zhigang Luo <zhigang.luo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h