Use amdgpu_vm_bo_move() for updating the NPA BO memory accounting stats
when the NPA BO is moved out from NPA domain into an empty placement.
Without this, when the app finishes, it spits out a warning:
"VM memory stats for proc .. task .. is non-zero when fini"

This was only affecting the memory accounting stats, we were not leaking
any memory here.

Signed-off-by: Mukul Joshi <[email protected]>
---
v1->v2:
- New change added.

 drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
index f6ad64be4349..8fed28dc7502 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
@@ -3056,12 +3056,7 @@ static void 
amdgpu_ualink_invalidate_import_mappings(struct amdgpu_bo *bo)
                }
        }
 
-       /* FIXME: This should be after the "if", but needs a fix to make sure
-        * DMABuf imports are initialized in the right VM list.
-        */
-       amdgpu_vm_bo_invalidate(bo, false);
-       if (!bo->tbo.resource || bo->tbo.resource->mem_type == TTM_PL_SYSTEM)
-               goto fini;
+       amdgpu_vm_bo_move(bo, NULL, false);
 
        r = ttm_bo_validate(&bo->tbo, &placement, &ctx);
        if (r) {
-- 
2.55.0

Reply via email to