drm/ttm: remove allow_errors parameter from ttm_bo_force_list_clean
Not allowing errors here is completely pointless and actually dangerous cause trying to continue on an error can cause an endless loop. Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Roger.He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
63d24f8846
commit
2ee7fc92cf
@ -1291,7 +1291,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
|
|||||||
EXPORT_SYMBOL(ttm_bo_create);
|
EXPORT_SYMBOL(ttm_bo_create);
|
||||||
|
|
||||||
static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
|
static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
|
||||||
unsigned mem_type, bool allow_errors)
|
unsigned mem_type)
|
||||||
{
|
{
|
||||||
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
|
struct ttm_mem_type_manager *man = &bdev->man[mem_type];
|
||||||
struct ttm_bo_global *glob = bdev->glob;
|
struct ttm_bo_global *glob = bdev->glob;
|
||||||
@ -1306,13 +1306,8 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
|
|||||||
while (!list_empty(&man->lru)) {
|
while (!list_empty(&man->lru)) {
|
||||||
spin_unlock(&glob->lru_lock);
|
spin_unlock(&glob->lru_lock);
|
||||||
ret = ttm_mem_evict_first(bdev, mem_type, NULL, false, false);
|
ret = ttm_mem_evict_first(bdev, mem_type, NULL, false, false);
|
||||||
if (ret) {
|
if (ret)
|
||||||
if (allow_errors) {
|
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
|
||||||
pr_err("Cleanup eviction failed\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
spin_lock(&glob->lru_lock);
|
spin_lock(&glob->lru_lock);
|
||||||
}
|
}
|
||||||
spin_unlock(&glob->lru_lock);
|
spin_unlock(&glob->lru_lock);
|
||||||
@ -1324,13 +1319,8 @@ static int ttm_bo_force_list_clean(struct ttm_bo_device *bdev,
|
|||||||
if (fence) {
|
if (fence) {
|
||||||
ret = dma_fence_wait(fence, false);
|
ret = dma_fence_wait(fence, false);
|
||||||
dma_fence_put(fence);
|
dma_fence_put(fence);
|
||||||
if (ret) {
|
if (ret)
|
||||||
if (allow_errors) {
|
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
|
||||||
pr_err("Cleanup eviction failed\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1359,7 +1349,11 @@ int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type)
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
if (mem_type > 0) {
|
if (mem_type > 0) {
|
||||||
ttm_bo_force_list_clean(bdev, mem_type, false);
|
ret = ttm_bo_force_list_clean(bdev, mem_type);
|
||||||
|
if (ret) {
|
||||||
|
pr_err("Cleanup eviction failed\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = (*man->func->takedown)(man);
|
ret = (*man->func->takedown)(man);
|
||||||
}
|
}
|
||||||
@ -1382,7 +1376,7 @@ int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ttm_bo_force_list_clean(bdev, mem_type, true);
|
return ttm_bo_force_list_clean(bdev, mem_type);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ttm_bo_evict_mm);
|
EXPORT_SYMBOL(ttm_bo_evict_mm);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user