Skip to contentSkip to conversation

drm/amdgpu: Add an extra evict_resource call during device_suspend.

PATCH In review Shikang Fan 2 participants 2 messages Dec 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Add an extra evict_resource call during device_suspend.

- evict_resource is taking too long causing sriov full access mode timeout. So, add an extra evict_resource in the beginning as an early evict.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -0
index 818fa72c670d..b76e8fdfd266 100644
@@ -4111,6 +4111,11 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	adev->in_suspend = true;
 
+	/* Evict the majority of BOs before grabbing the full access */
+	r = amdgpu_device_evict_resources(adev);
+	if (r)
+		return r;
+
 	if (amdgpu_sriov_vf(adev)) {
 		amdgpu_virt_fini_data_exchange(adev);
 		r = amdgpu_virt_request_full_gpu(adev, false);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Am 08.12.22 um 12:55 schrieb Shikang Fan:

Quoted 4 lines

- evict_resource is taking too long causing sriov full access mode timeout. So, add an extra evict_resource in the beginning as an early evict.

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -0
index 818fa72c670d..b76e8fdfd266 100644
@@ -4111,6 +4111,11 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
  	adev->in_suspend = true;
 
+	/* Evict the majority of BOs before grabbing the full access */
+	r = amdgpu_device_evict_resources(adev);
+	if (r)
+		return r;
+
  	if (amdgpu_sriov_vf(adev)) {
  		amdgpu_virt_fini_data_exchange(adev);
  		r = amdgpu_virt_request_full_gpu(adev, false);