]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
drm/xe/xe_sync: avoid race during ufence signaling
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Wed, 20 Aug 2025 08:39:04 +0000 (10:39 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 26 Aug 2025 14:12:11 +0000 (10:12 -0400)
commit04e1f683cd28dc9407b238543871a6e09a570dc0
tree814b445ebeb01ac21b4a200cf0592453046a6e26
parent1b237f190eb3d36f52dffe07a40b5eb210280e00
drm/xe/xe_sync: avoid race during ufence signaling

Marking ufence as signalled after copy_to_user() is too late.
Worker thread which signals ufence by memory write might be raced
with another userspace vm-bind call. In map/unmap scenario unmap
may still see ufence is not signalled causing -EBUSY. Change the
order of marking / write to user-fence fixes this issue.

Fixes: 977e5b82e090 ("drm/xe: Expose user fence from xe_sync_entry")
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5536
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20250820083903.2109891-2-zbigniew.kempczynski@intel.com
(cherry picked from commit 8ae04fe9ffc93d6bc3bc63ac08375427d69cee06)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_sync.c