提交 481c2e94 编写于 作者: C Christian König 提交者: Alex Deucher

drm/amdgpu: fix moved list handling in the VM

Only move BOs to the moved/relocated list when they aren't already on a list.

This prevents accidential removal from the evicted list.
Signed-off-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 f5830465
...@@ -1178,7 +1178,8 @@ static void amdgpu_vm_invalidate_level(struct amdgpu_vm *vm, ...@@ -1178,7 +1178,8 @@ static void amdgpu_vm_invalidate_level(struct amdgpu_vm *vm,
entry->addr = ~0ULL; entry->addr = ~0ULL;
spin_lock(&vm->status_lock); spin_lock(&vm->status_lock);
list_move(&entry->base.vm_status, &vm->relocated); if (list_empty(&entry->base.vm_status))
list_add(&entry->base.vm_status, &vm->relocated);
spin_unlock(&vm->status_lock); spin_unlock(&vm->status_lock);
amdgpu_vm_invalidate_level(vm, entry); amdgpu_vm_invalidate_level(vm, entry);
} }
...@@ -2091,7 +2092,8 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev, ...@@ -2091,7 +2092,8 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev,
if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) { if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
spin_lock(&vm->status_lock); spin_lock(&vm->status_lock);
list_move(&bo_va->base.vm_status, &vm->moved); if (list_empty(&bo_va->base.vm_status))
list_add(&bo_va->base.vm_status, &vm->moved);
spin_unlock(&vm->status_lock); spin_unlock(&vm->status_lock);
} }
trace_amdgpu_vm_bo_map(bo_va, mapping); trace_amdgpu_vm_bo_map(bo_va, mapping);
...@@ -2446,7 +2448,8 @@ void amdgpu_vm_bo_invalidate(struct amdgpu_device *adev, ...@@ -2446,7 +2448,8 @@ void amdgpu_vm_bo_invalidate(struct amdgpu_device *adev,
} }
spin_lock(&bo_base->vm->status_lock); spin_lock(&bo_base->vm->status_lock);
list_move(&bo_base->vm_status, &bo_base->vm->moved); if (list_empty(&bo_base->vm_status))
list_add(&bo_base->vm_status, &vm->moved);
spin_unlock(&bo_base->vm->status_lock); spin_unlock(&bo_base->vm->status_lock);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册