]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/ttm: Should to return the evict error
authorEmily Deng <Emily.Deng@amd.com>
Tue, 3 Jun 2025 09:11:54 +0000 (17:11 +0800)
committerChristian König <christian.koenig@amd.com>
Wed, 11 Jun 2025 11:14:43 +0000 (13:14 +0200)
For the evict fail case, the evict error should be returned.

v2: Consider ENOENT case.

v3: Abort directly when the eviction failed for some reason (except for -ENOENT)
 and not wait for the move to finish

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20250603091154.3472646-1-Emily.Deng@amd.com
drivers/gpu/drm/ttm/ttm_resource.c

index 769b0ca9be47b98838c24107767876041edd2ffc..006202fcd3c20eeb119afc60f24773436d4079d2 100644 (file)
@@ -557,6 +557,9 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
                cond_resched();
        } while (!ret);
 
+       if (ret && ret != -ENOENT)
+               return ret;
+
        spin_lock(&man->move_lock);
        fence = dma_fence_get(man->move);
        spin_unlock(&man->move_lock);