drm/amdgpu: vm flush needed after updating PDEs
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 10 May 2022 14:29:54 +0000 (10:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 May 2022 21:53:13 +0000 (17:53 -0400)
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.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 7276b03..9596c22 100644 (file)
@@ -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,