Skip to content

Commit 37a1cf2

Browse files
nirmoyThomas Hellström
authored andcommitted
drm/xe/ufence: Wake up waiters after setting ufence->signalled
If a previous ufence is not signalled, vm_bind will return -EBUSY. Delaying the modification of ufence->signalled can cause issues if the UMD reuses the same ufence so update ufence->signalled before waking up waiters. Cc: Matthew Brost <[email protected]> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3233 Fixes: 977e5b8 ("drm/xe: Expose user fence from xe_sync_entry") Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Nirmoy Das <[email protected]> (cherry picked from commit 553a5d1) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 6d9f911 commit 37a1cf2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/xe/xe_sync.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ static void user_fence_worker(struct work_struct *w)
8787
drm_dbg(&ufence->xe->drm, "mmget_not_zero() failed, ufence wasn't signaled\n");
8888
}
8989

90-
wake_up_all(&ufence->xe->ufence_wq);
90+
/*
91+
* Wake up waiters only after updating the ufence state, allowing the UMD
92+
* to safely reuse the same ufence without encountering -EBUSY errors.
93+
*/
9194
WRITE_ONCE(ufence->signalled, 1);
95+
wake_up_all(&ufence->xe->ufence_wq);
9296
user_fence_put(ufence);
9397
}
9498

0 commit comments

Comments
 (0)