Skip to contentSkip to conversation

drm/amdgpu: vm flush needed after updating PDEs

PATCH In review Philip Yang 2 participants 2 messages May 10, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: vm flush needed after updating PDEs

If page table PDEs is evicted and restored, after updating PDEs, need increase vm->tlb_seq, then amdgpu_vm_flush will flush TLB before command submission.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 -0
index 7276b03ef970..9596c22fded6 100644
@@ -764,6 +764,9 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
 	if (r)
 		goto error;
 
+	/* vm_flush_needed after updating PDEs */
+	atomic64_inc(&vm->tlb_seq);
+
 	while (!list_empty(&vm->relocated)) {
 		entry = list_first_entry(&vm->relocated,
 					 struct amdgpu_vm_bo_base,
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 10.05.22 um 16:36 schrieb Philip Yang:

Quoted 5 lines

If page table PDEs is evicted and restored, after updating PDEs, need increase vm->tlb_seq, then amdgpu_vm_flush will flush TLB before command submission.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 -0
index 7276b03ef970..9596c22fded6 100644
@@ -764,6 +764,9 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
  	if (r)
  		goto error;
 
+	/* vm_flush_needed after updating PDEs */
+	atomic64_inc(&vm->tlb_seq);
+
  	while (!list_empty(&vm->relocated)) {
  		entry = list_first_entry(&vm->relocated,
  					 struct amdgpu_vm_bo_base,