drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data
authorJingwen Chen <Jingwen.Chen2@amd.com>
Tue, 19 Jan 2021 08:54:50 +0000 (16:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Mar 2021 11:34:12 +0000 (12:34 +0100)
commit4b73f01d5ebde3409df1206727fb2fd20fefe7cf
treea53485f820de7e80141be1f2df6ea6e0485d2712
parenta986f9345467b8d39f0aff39d80207e4e91aae0c
drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data

[ Upstream commit 64dcf2f01d59cf9fad19b1a387bd39736a8f4d69 ]

[Why]
when vram lost happened in guest, try to write vram can lead to
kernel stuck.

[How]
When the readback data is invalid, don't do write work, directly
reschedule a new work.

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c