Skip to contentSkip to conversation

drm/amdgpu: Ignore first evction failure during suspend

PATCH New xinhui pan 1 participant 1 message Sep 12, 2023

Subsystems (2)
lore
Share & tools
lore

xinhui pan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Ignore first evction failure during suspend

Some BOs might be in use or locked and then the first eviction's failure will abort the suspend sequence. We will try to unlock or stop any user accessing these BOs afterwards during suspend. So only the second eviction should succeed.

Actaully the first eviction has evicted most BOs, so that should still work fine in sriov full access mode.

Fixes 47ea20762bb7 ("drm/amdgpu: Add an extra evict_resource call during device_suspend.")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -4
index 5c0e2b766026..f381cb90c964 100644
@@ -4148,10 +4148,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;
+	/* Try to evict the majority of BOs before grabbing the full access
+	 * Ignore the ret val at first place as we will unlock or stop accessing
+	 * any BOs afterwards.
+	 */
+	(void)amdgpu_device_evict_resources(adev);
 
 	if (amdgpu_sriov_vf(adev)) {
 		amdgpu_virt_fini_data_exchange(adev);
Signature · 1 line
2.34.1