From 483bfc8ea604644bc3d7b36f586bbab7e98b0189 Mon Sep 17 00:00:00 2001 From: DesktopECHO <33142753+DesktopECHO@users.noreply.github.com> Date: Wed, 15 Jul 2026 22:46:35 -0300 Subject: [PATCH] drm/asahi: Clean up deferred BOs when dropping a VM Since immediate mode was enabled, unmapping a GPU VA can defer drm_gpuvm_bo destruction until drm_gpuvm_bo_deferred_cleanup() is called. The GEM bind and unbind paths drain that list, but Vm::drop() unmaps the remaining user ranges without doing so. Drain the deferred list after both teardown unmaps. Otherwise a deferred drm_gpuvm_bo retains the imported GEM and dma-buf after its DRM file is closed, leaving its backing pages pinned. Fixes: 2aeee2dd4a79 ("drm/asahi: Switch gpuvm to DRM_GPUVM_IMMEDIATE_MODE") Signed-off-by: DesktopECHO <33142753+DesktopECHO@users.noreply.github.com> --- drivers/gpu/drm/asahi/file.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/asahi/file.rs b/drivers/gpu/drm/asahi/file.rs index 02a4ce874a92c8..061f289e40d933 100644 --- a/drivers/gpu/drm/asahi/file.rs +++ b/drivers/gpu/drm/asahi/file.rs @@ -87,6 +87,8 @@ impl Drop for Vm { { pr_err!("Vm::Drop: vm.unmap_range() failed\n"); } + + self.vm.bo_deferred_cleanup(); } }