Skip to content

Commit 86404a9

Browse files
Anna ManiscalcoRob Clark
authored andcommitted
drm/msm: make sure last_fence is always updated
Update last_fence in the vm-bind path instead of kernel managed path. last_fence is used to wait for work to finish in vm_bind contexts but not used for kernel managed contexts. This fixes a bug where last_fence is not waited on context close leading to faults as resources are freed while in use. Fixes: 92395af ("drm/msm: Add VM_BIND submitqueue") Signed-off-by: Anna Maniscalco <anna.maniscalco2000@gmail.com> Patchwork: https://patchwork.freedesktop.org/patch/680080/ Message-ID: <20251011-close_fence_wait_fix-v3-1-5134787755ff@gmail.com> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
1 parent b4789aa commit 86404a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ static void submit_attach_object_fences(struct msm_gem_submit *submit)
414414
submit->user_fence,
415415
DMA_RESV_USAGE_BOOKKEEP,
416416
DMA_RESV_USAGE_BOOKKEEP);
417+
418+
last_fence = vm->last_fence;
419+
vm->last_fence = dma_fence_unwrap_merge(submit->user_fence, last_fence);
420+
dma_fence_put(last_fence);
421+
417422
return;
418423
}
419424

@@ -427,10 +432,6 @@ static void submit_attach_object_fences(struct msm_gem_submit *submit)
427432
dma_resv_add_fence(obj->resv, submit->user_fence,
428433
DMA_RESV_USAGE_READ);
429434
}
430-
431-
last_fence = vm->last_fence;
432-
vm->last_fence = dma_fence_unwrap_merge(submit->user_fence, last_fence);
433-
dma_fence_put(last_fence);
434435
}
435436

436437
static int submit_bo(struct msm_gem_submit *submit, uint32_t idx,

0 commit comments

Comments
 (0)