void *param)
{
struct ttm_bo_global *glob = adev->mman.bdev.glob;
- int r;
-
- while (!list_empty(&vm->evicted)) {
- struct amdgpu_vm_bo_base *bo_base;
- struct amdgpu_bo *bo;
+ struct amdgpu_vm_bo_base *bo_base, *tmp;
+ int r = 0;
- bo_base = list_first_entry(&vm->evicted,
- struct amdgpu_vm_bo_base,
- vm_status);
+ list_for_each_entry_safe(bo_base, tmp, &vm->evicted, vm_status) {
+ struct amdgpu_bo *bo = bo_base->bo;
- bo = bo_base->bo;
if (bo->parent) {
r = validate(param, bo);
if (r)
- return r;
+ break;
spin_lock(&glob->lru_lock);
ttm_bo_move_to_lru_tail(&bo->tbo);
vm->use_cpu_for_update) {
r = amdgpu_bo_kmap(bo, NULL);
if (r)
- return r;
+ break;
}
if (bo->tbo.type != ttm_bo_type_kernel) {
}
}
- return 0;
+ return r;
}
/**