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>
Tue, 13 Jul 2021 15:48:09 +0000 (11:48 -0400)
commit798c511548b946ae9ec123b0dfe197a5f29e63ec
tree21f96cd2114233c656d2507b22ff5667e0385a6b
parent1e7b5812f4890ad84058bbb6c4a5deddfb2c5b25
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