amdgpu_vm_make_npa() builds the UALink NPA VM on top of
amdgpu_vm_make_compute(), which unconditionally sets need_tlb_fence.
That flag makes amdgpu_vm_tlb_flush() queue an asynchronous PASID based
TLB invalidation after every page table update.

The NPA VM is created by the driver itself in
amdgpu_ualink_manager_start() and never gets a PASID assigned, so
vm->pasid stays 0, which MES cannot resolve on the MMHUB. The invalidation
never completes and MES stays unresponsive for the rest of the probe:

  amdgpu: MES(0, 0) failed to respond to msg=INVALIDATE_TLBS

The invalidation is not needed in the first place. An NPA VM is bound to
the reserved NPA VMID and amdgpu_ualink_flush_tlb() already invalidates
that VMID on the MMHUB after every mapping change. Clear need_tlb_fence
for NPA VMs.

Fixes: aac13f6eded6 ("drm/amdgpu: Pin page tables in NPA VMs")
Signed-off-by: Horatio Zhang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 68d668dfe4f8..e255b5100362 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2793,6 +2793,7 @@ int amdgpu_vm_make_npa(struct amdgpu_device *adev, struct 
amdgpu_vm *vm)
                return r;
 
        vm->is_npa = true;
+       vm->need_tlb_fence = false;
 
        return 0;
 }
-- 
2.43.0

Reply via email to