[PATCH 1/2] drm/amdgpu: fix PRT cleanup order in the VM

Christian König deathsimple at vodafone.de
Mon Feb 13 13:23:52 UTC 2017


From: Christian König <christian.koenig at amd.com>

We need to unmap the PRTs first and then free our scheduler entity.

Signed-off-by: Christian König <christian.koenig at 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 bc32239..0b7386e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1687,8 +1687,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 	struct amdgpu_bo_va_mapping *mapping, *tmp;
 	int i;
 
-	amd_sched_entity_fini(vm->entity.sched, &vm->entity);
-
 	if (!RB_EMPTY_ROOT(&vm->va)) {
 		dev_err(adev->dev, "still active bo inside vm\n");
 	}
@@ -1706,6 +1704,8 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 	}
 	amdgpu_vm_clear_freed(adev, vm);
 
+	amd_sched_entity_fini(vm->entity.sched, &vm->entity);
+
 	for (i = 0; i < amdgpu_vm_num_pdes(adev); i++) {
 		struct amdgpu_bo *pt = vm->page_tables[i].bo;
 
-- 
2.5.0



More information about the amd-gfx mailing list