drm/amd: Run KFD/userq suspend and resume routines for s0ix
Subsystems (2)
PATCH v3 1/1 drm/amd: Run KFD/userq suspend and resume routines for s0ix
KFD suspend and resume routines have been disabled since commit 5d3a2d95224da ("drm/amdgpu: skip kfd suspend/resume for S0ix") which made sense at that time. However there is a problem that if there is any compute work running there may still be active fences. Running suspend without draining them can cause the system to hang.
The same problem can also occur with user queues too.
So run KFD and user queue suspend/resume routines even in s0ix on GFX11 or newer.
Signed-off-by Mario Limonciello <[email protected]>
---
v3:
* only apply to GC 11.0.1 and later
* drop tags
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
@@ -5220,7 +5220,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)amdgpu_device_ip_suspend_phase1 (adev); -if (!adev->in_s0ix) { +if (!adev->in_s0ix || (adev->in_s0ix &&amdgpu_ip_version (adev,GC_HWIP ,0 ) >=IP_VERSION (11 ,0 ,1 ))) {amdgpu_amdkfd_suspend (adev, !amdgpu_sriov_vf (adev) && !adev->in_runpm);amdgpu_userq_suspend (adev); }
@@ -5318,7 +5318,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients) goto exit; } -if (!adev->in_s0ix) { +if (!adev->in_s0ix || (adev->in_s0ix &&amdgpu_ip_version (adev,GC_HWIP ,0 ) >=IP_VERSION (11 ,0 ,1 ))) { r =amdgpu_amdkfd_resume (adev, !amdgpu_sriov_vf (adev) && !adev->in_runpm);if (r) goto exit;
Signature · 1 line
2.50.1