OSDN Git Service

drm/amdgpu: SRIOV flr_work should take write_lock
authorJingwen Chen <Jingwen.Chen2@amd.com>
Thu, 1 Jul 2021 02:19:17 +0000 (10:19 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 8 Jul 2021 19:12:58 +0000 (15:12 -0400)
commitb5840166dcb8bb03daa420f6c84eb78d46b713e7
treeaec238e6c1a74bfc6d6c826b90e67d3255134c69
parentc0838d3a93fc5e51b4a9654f53f499da1778dad8
drm/amdgpu: SRIOV flr_work should take write_lock

[Why]
If flr_work takes read_lock, then other threads who takes
read_lock can access hardware when host is doing vf flr.

[How]
flr_work should take write_lock to avoid this case.

Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c