Skip to contentSkip to conversation

drm/amdgpu: Move kfd suspend before evict resource

PATCH In review xinhui pan 2 participants 2 messages Sep 21, 2023

Subsystems (2)
lore
Share & tools
lore

xinhui pan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Move kfd suspend before evict resource

Like amdgpu_device_reset_sriov does, kfd suspend should be called at the beginning to make sure kfd BO is idle. Otherwise the extra amdgpu_device_evict_resources fails or amdgpu_virt_request_full_gpu timeout.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -3
index a084c3c58a32..ef7c7f2b3260 100644
@@ -4148,6 +4148,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	adev->in_suspend = true;
 
+	if (!adev->in_s0ix)
+		amdgpu_amdkfd_suspend(adev, adev->in_runpm);
+
 	/* Evict the majority of BOs before grabbing the full access */
 	r = amdgpu_device_evict_resources(adev);
 	if (r)
@@ -4174,9 +4177,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	amdgpu_device_ip_suspend_phase1(adev);
 
-	if (!adev->in_s0ix)
-		amdgpu_amdkfd_suspend(adev, adev->in_runpm);
-
 	r = amdgpu_device_evict_resources(adev);
 	if (r)
 		return r;
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · xinhui pan

Like amdgpu_device_reset_sriov does, kfd suspend should be called at the beginning to make sure kfd BO is idle. Otherwise the extra amdgpu_device_evict_resources fails or amdgpu_virt_request_full_gpu timeout.

Quoted 28 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -3
index a084c3c58a32..ef7c7f2b3260 100644
@@ -4148,6 +4148,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
  	adev->in_suspend = true;
 
+	if (!adev->in_s0ix)
+		amdgpu_amdkfd_suspend(adev, adev->in_runpm);
+
  	/* Evict the majority of BOs before grabbing the full access */
  	r = amdgpu_device_evict_resources(adev);
  	if (r)
@@ -4174,9 +4177,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
  	amdgpu_device_ip_suspend_phase1(adev);
 
-	if (!adev->in_s0ix)
-		amdgpu_amdkfd_suspend(adev, adev->in_runpm);
-
  	r = amdgpu_device_evict_resources(adev);
  	if (r)
  		return r;