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

drm/amdgpu: move lockdep assert to the right place.

Since newly added BOs don't have any mappings it's ok to add them
without holding the VM lock. Only when we add per VM BOs the lock is
mandatory.
Signed-off-by: NChristian König <christian.koenig@amd.com>
Reported-by: NBhardwaj, Rajneesh <Rajneesh.Bhardwaj@amd.com>
Acked-by: NAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 66d58bf7
...@@ -375,6 +375,8 @@ static void amdgpu_vm_bo_base_init(struct amdgpu_vm_bo_base *base, ...@@ -375,6 +375,8 @@ static void amdgpu_vm_bo_base_init(struct amdgpu_vm_bo_base *base,
if (bo->tbo.base.resv != vm->root.bo->tbo.base.resv) if (bo->tbo.base.resv != vm->root.bo->tbo.base.resv)
return; return;
dma_resv_assert_held(vm->root.bo->tbo.base.resv);
vm->bulk_moveable = false; vm->bulk_moveable = false;
if (bo->tbo.type == ttm_bo_type_kernel && bo->parent) if (bo->tbo.type == ttm_bo_type_kernel && bo->parent)
amdgpu_vm_bo_relocated(base); amdgpu_vm_bo_relocated(base);
...@@ -2244,8 +2246,6 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev, ...@@ -2244,8 +2246,6 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev,
{ {
struct amdgpu_bo_va *bo_va; struct amdgpu_bo_va *bo_va;
dma_resv_assert_held(vm->root.bo->tbo.base.resv);
bo_va = kzalloc(sizeof(struct amdgpu_bo_va), GFP_KERNEL); bo_va = kzalloc(sizeof(struct amdgpu_bo_va), GFP_KERNEL);
if (bo_va == NULL) { if (bo_va == NULL) {
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册