drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +5 -1
@@ -558,10 +558,14 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev)static void amdgpu_virt_update_vf2pf_work_item (struct work_struct *work) { struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work); +int ret; -amdgpu_virt_read_pf2vf_data (adev); + ret =amdgpu_virt_read_pf2vf_data (adev); +if (ret) + goto out;amdgpu_virt_write_vf2pf_data (adev); +out:schedule_delayed_work (&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms); }
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Approved for External Use]
Ping
Best Regards,
JingWen Chen
-----Original Message-----
From: Jingwen Chen <[email protected]>
Sent: Tuesday, January 19, 2021 5:07 PM
To: [email protected]
Cc: Chen, JingWen <[email protected]>; Chen, JingWen <[email protected]>
Subject: [PATCH] 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +5 -2
@@ -558,10 +558,14 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev) static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work) { struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work); +int ret; -amdgpu_virt_read_pf2vf_data (adev); + ret =amdgpu_virt_read_pf2vf_data (adev); +if (ret) + goto out;amdgpu_virt_write_vf2pf_data (adev); +out:schedule_delayed_work (&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms); } --
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Liu, Monk
Reviewed-by[AMD Official Use Only - Approved for External Use]
Thanks
------------------------------------------
Monk Liu | Cloud-GPU Core team
------------------------------------------
-----Original Message-----
From: Chen, JingWen <[email protected]>
Sent: Thursday, January 21, 2021 11:13 AM
To: [email protected]; Liu, Monk <[email protected]>
Cc: Chen, JingWen <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: add error handling to amdgpu_virt_read_pf2vf_data
[AMD Official Use Only - Approved for External Use]
Ping
Best Regards,
JingWen Chen
-----Original Message-----
From: Jingwen Chen <[email protected]>
Sent: Tuesday, January 19, 2021 5:07 PM
To: [email protected]
Cc: Chen, JingWen <[email protected]>; Chen, JingWen <[email protected]>
Subject: [PATCH] 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +5 -2
@@ -558,10 +558,14 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev) static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work) { struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work); +int ret; -amdgpu_virt_read_pf2vf_data (adev); + ret =amdgpu_virt_read_pf2vf_data (adev); +if (ret) + goto out;amdgpu_virt_write_vf2pf_data (adev); +out:schedule_delayed_work (&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms); } --
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx