All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: call amdgpu_vm_prt_fini before deleting the root PD
@ 2019-10-23 12:02 ` Pelloux-prayer, Pierre-eric
  0 siblings, 0 replies; 4+ messages in thread
From: Pelloux-prayer, Pierre-eric @ 2019-10-23 12:02 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Pelloux-prayer, Pierre-eric

amdgpu_vm_prt_fini uses "vm->root.base.bo" so it must still be valid when
we call it.

Fixes: b65709a92156 ("drm/amdgpu: reserve the root PD while freeing PASIDs")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index d9bece987e60..c8ce42200059 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2975,6 +2975,16 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 		vm->pasid = 0;
 	}
 
+	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
+		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
+			amdgpu_vm_prt_fini(adev, vm);
+			prt_fini_needed = false;
+		}
+
+		list_del(&mapping->list);
+		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
+	}
+
 	amdgpu_vm_free_pts(adev, vm, NULL);
 	amdgpu_bo_unreserve(root);
 	amdgpu_bo_unref(&root);
@@ -2994,15 +3004,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 		list_del(&mapping->list);
 		kfree(mapping);
 	}
-	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
-		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
-			amdgpu_vm_prt_fini(adev, vm);
-			prt_fini_needed = false;
-		}
-
-		list_del(&mapping->list);
-		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
-	}
 
 	dma_fence_put(vm->last_update);
 	for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
-- 
2.23.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH] drm/amdgpu: call amdgpu_vm_prt_fini before deleting the root PD
@ 2019-10-23 12:02 ` Pelloux-prayer, Pierre-eric
  0 siblings, 0 replies; 4+ messages in thread
From: Pelloux-prayer, Pierre-eric @ 2019-10-23 12:02 UTC (permalink / raw)
  To: amd-gfx; +Cc: Pelloux-prayer, Pierre-eric

amdgpu_vm_prt_fini uses "vm->root.base.bo" so it must still be valid when
we call it.

Fixes: b65709a92156 ("drm/amdgpu: reserve the root PD while freeing PASIDs")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index d9bece987e60..c8ce42200059 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2975,6 +2975,16 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 		vm->pasid = 0;
 	}
 
+	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
+		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
+			amdgpu_vm_prt_fini(adev, vm);
+			prt_fini_needed = false;
+		}
+
+		list_del(&mapping->list);
+		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
+	}
+
 	amdgpu_vm_free_pts(adev, vm, NULL);
 	amdgpu_bo_unreserve(root);
 	amdgpu_bo_unref(&root);
@@ -2994,15 +3004,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 		list_del(&mapping->list);
 		kfree(mapping);
 	}
-	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
-		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
-			amdgpu_vm_prt_fini(adev, vm);
-			prt_fini_needed = false;
-		}
-
-		list_del(&mapping->list);
-		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
-	}
 
 	dma_fence_put(vm->last_update);
 	for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
-- 
2.23.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: call amdgpu_vm_prt_fini before deleting the root PD
@ 2019-10-23 12:38     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2019-10-23 12:38 UTC (permalink / raw)
  To: Pelloux-prayer, Pierre-eric, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 23.10.19 um 14:02 schrieb Pelloux-prayer, Pierre-eric:
> amdgpu_vm_prt_fini uses "vm->root.base.bo" so it must still be valid when
> we call it.
>
> Fixes: b65709a92156 ("drm/amdgpu: reserve the root PD while freeing PASIDs")
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index d9bece987e60..c8ce42200059 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -2975,6 +2975,16 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>   		vm->pasid = 0;
>   	}
>   
> +	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
> +		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
> +			amdgpu_vm_prt_fini(adev, vm);
> +			prt_fini_needed = false;
> +		}
> +
> +		list_del(&mapping->list);
> +		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
> +	}
> +
>   	amdgpu_vm_free_pts(adev, vm, NULL);
>   	amdgpu_bo_unreserve(root);
>   	amdgpu_bo_unref(&root);
> @@ -2994,15 +3004,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>   		list_del(&mapping->list);
>   		kfree(mapping);
>   	}
> -	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
> -		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
> -			amdgpu_vm_prt_fini(adev, vm);
> -			prt_fini_needed = false;
> -		}
> -
> -		list_del(&mapping->list);
> -		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
> -	}
>   
>   	dma_fence_put(vm->last_update);
>   	for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: call amdgpu_vm_prt_fini before deleting the root PD
@ 2019-10-23 12:38     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2019-10-23 12:38 UTC (permalink / raw)
  To: Pelloux-prayer, Pierre-eric, amd-gfx

Am 23.10.19 um 14:02 schrieb Pelloux-prayer, Pierre-eric:
> amdgpu_vm_prt_fini uses "vm->root.base.bo" so it must still be valid when
> we call it.
>
> Fixes: b65709a92156 ("drm/amdgpu: reserve the root PD while freeing PASIDs")
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index d9bece987e60..c8ce42200059 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -2975,6 +2975,16 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>   		vm->pasid = 0;
>   	}
>   
> +	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
> +		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
> +			amdgpu_vm_prt_fini(adev, vm);
> +			prt_fini_needed = false;
> +		}
> +
> +		list_del(&mapping->list);
> +		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
> +	}
> +
>   	amdgpu_vm_free_pts(adev, vm, NULL);
>   	amdgpu_bo_unreserve(root);
>   	amdgpu_bo_unref(&root);
> @@ -2994,15 +3004,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>   		list_del(&mapping->list);
>   		kfree(mapping);
>   	}
> -	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
> -		if (mapping->flags & AMDGPU_PTE_PRT && prt_fini_needed) {
> -			amdgpu_vm_prt_fini(adev, vm);
> -			prt_fini_needed = false;
> -		}
> -
> -		list_del(&mapping->list);
> -		amdgpu_vm_free_mapping(adev, vm, mapping, NULL);
> -	}
>   
>   	dma_fence_put(vm->last_update);
>   	for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-10-23 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23 12:02 [PATCH] drm/amdgpu: call amdgpu_vm_prt_fini before deleting the root PD Pelloux-prayer, Pierre-eric
2019-10-23 12:02 ` Pelloux-prayer, Pierre-eric
     [not found] ` <20191023120221.13537-1-pierre-eric.pelloux-prayer-5C7GfCeVMHo@public.gmane.org>
2019-10-23 12:38   ` Christian König
2019-10-23 12:38     ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.