Skip to content

Commit 64dcf2f

Browse files
Jingwen Chenalexdeucher
authored andcommitted
drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data
[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>
1 parent 9024fb0 commit 64dcf2f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,14 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev)
560560
static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work)
561561
{
562562
struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work);
563+
int ret;
563564

564-
amdgpu_virt_read_pf2vf_data(adev);
565+
ret = amdgpu_virt_read_pf2vf_data(adev);
566+
if (ret)
567+
goto out;
565568
amdgpu_virt_write_vf2pf_data(adev);
566569

570+
out:
567571
schedule_delayed_work(&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms);
568572
}
569573

0 commit comments

Comments
 (0)