]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/xe/preempt_fence: enlarge the fence critical section
authorMatthew Auld <matthew.auld@intel.com>
Thu, 18 Apr 2024 14:46:31 +0000 (15:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:12 +0000 (15:34 +0200)
commit458bb83119dfee5d14c677f7846dd9363817006f
treef268954b4a6ca58d3c81d95de4750ebe2fa29615
parent28bbb5011a9723700006da67bdb57ab6a914452b
drm/xe/preempt_fence: enlarge the fence critical section

[ Upstream commit 3cd1585e57908b6efcd967465ef7685f40b2a294 ]

It is really easy to introduce subtle deadlocks in
preempt_fence_work_func() since we operate on single global ordered-wq
for signalling our preempt fences behind the scenes, so even though we
signal a particular fence, everything in the callback should be in the
fence critical section, since blocking in the callback will prevent
other published fences from signalling. If we enlarge the fence critical
section to cover the entire callback, then lockdep should be able to
understand this better, and complain if we grab a sensitive lock like
vm->lock, which is also held when waiting on preempt fences.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240418144630.299531-2-matthew.auld@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/xe/xe_preempt_fence.c