Skip to contentSkip to conversation

drm/ttm: Should to return the evict error

PATCH Superseded Emily Deng 1 participant 1 message May 21, 2025

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 drm/ttm: Should to return the evict error

For the evict fail case, the evict error should be returned.

---
 drivers/gpu/drm/ttm/ttm_resource.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/ttm/ttm_resource.c +4 -4
index 097716bd248a..57e275baa09e 100644
@@ -511,12 +511,12 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
 		.force_alloc = true
 	};
 	struct dma_fence *fence;
-	int ret;
+	int ret, evict_ret = 0;
 
 	do {
-		ret = ttm_bo_evict_first(bdev, man, &ctx);
+		evict_ret = ttm_bo_evict_first(bdev, man, &ctx);
 		cond_resched();
-	} while (!ret);
+	} while (!evict_ret);
 
 	spin_lock(&man->move_lock);
 	fence = dma_fence_get(man->move);
@@ -529,7 +529,7 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
 			return ret;
 	}
 
-	return 0;
+	return evict_ret;
 }
 EXPORT_SYMBOL(ttm_resource_manager_evict_all);
 
Signature · 1 line
2.34.1