[PATCH 09/11] drm/ttm: convert EDEADLK into EAGAIN

Christian König ckoenig.leichtzumerken at gmail.com
Tue May 14 12:31:25 UTC 2019


Let userspace try again if we really run into a deadlock during eviction.

This has a low chance of live locking, but with guaranteed forward process.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index a301c876ae31..ce85cd8b4970 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -877,6 +877,8 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
 					    acquire_ctx);
 		if (ret) {
 			ttm_bo_put(first_bo);
+			if (ret == -EDEADLK)
+				ret = -EAGAIN;
 			return ret;
 		}
 		spin_lock(&glob->lru_lock);
-- 
2.17.1



More information about the amd-gfx mailing list