]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:25:58 +0000 (16:25 +0200)
[ Upstream commit 4e16a9a00239db5d819197b9a00f70665951bf50 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/ttm/ttm_resource.c

index 3287032a2f8e8ee817a3b6c8ce4354abfec94b4b..ad3c398fc2782f3687ce7d4ce638b27d872d2058 100644 (file)
@@ -437,6 +437,9 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,
        }
        spin_unlock(&bdev->lru_lock);
 
+       if (ret && ret != -ENOENT)
+               return ret;
+
        spin_lock(&man->move_lock);
        fence = dma_fence_get(man->move);
        spin_unlock(&man->move_lock);