AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: move lockdep assert to the right place.
@ 2022-02-04  8:52 Christian König
  2022-02-04 14:28 ` Deucher, Alexander
  2022-02-04 16:27 ` Felix Kuehling
  0 siblings, 2 replies; 9+ messages in thread
From: Christian König @ 2022-02-04  8:52 UTC (permalink / raw)
  To: Rajneesh.Bhardwaj, amd-gfx

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: Christian König <christian.koenig@amd.com>
Reported-by: Bhardwaj, Rajneesh <Rajneesh.Bhardwaj@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index fdc6a1fd74af..dcc80d6e099e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -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)
 		return;
 
+	dma_resv_assert_held(vm->root.bo->tbo.base.resv);
+
 	vm->bulk_moveable = false;
 	if (bo->tbo.type == ttm_bo_type_kernel && bo->parent)
 		amdgpu_vm_bo_relocated(base);
@@ -2260,8 +2262,6 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev,
 {
 	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);
 	if (bo_va == NULL) {
 		return NULL;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-07  7:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-04  8:52 [PATCH] drm/amdgpu: move lockdep assert to the right place Christian König
2022-02-04 14:28 ` Deucher, Alexander
2022-02-04 16:27 ` Felix Kuehling
2022-02-04 18:12   ` Bhardwaj, Rajneesh
2022-02-04 18:32     ` Christian König
2022-02-04 18:47       ` Bhardwaj, Rajneesh
2022-02-04 18:50         ` Christian König
2022-02-04 19:15           ` Bhardwaj, Rajneesh
2022-02-07  7:24             ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox