Skip to content

Commit aff98ba

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/ttm: wait for eviction in ttm_bo_force_list_clean
Now that we can pipeline evictions we need to wait for them to finish when we cleanup a memory domain. Signed-off-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9a79588 commit aff98ba

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,7 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
12871287
{
12881288
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
12891289
struct ttm_bo_global *glob = bdev->glob;
1290+
struct fence *fence;
12901291
int ret;
12911292

12921293
/*
@@ -1307,6 +1308,23 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
13071308
spin_lock(&glob->lru_lock);
13081309
}
13091310
spin_unlock(&glob->lru_lock);
1311+
1312+
spin_lock(&man->move_lock);
1313+
fence = fence_get(man->move);
1314+
spin_unlock(&man->move_lock);
1315+
1316+
if (fence) {
1317+
ret = fence_wait(fence, false);
1318+
fence_put(fence);
1319+
if (ret) {
1320+
if (allow_errors) {
1321+
return ret;
1322+
} else {
1323+
pr_err("Cleanup eviction failed\n");
1324+
}
1325+
}
1326+
}
1327+
13101328
return 0;
13111329
}
13121330

0 commit comments

Comments
 (0)