public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Comment userptr recursion on struct_mutex
@ 2019-08-14 12:49 Daniel Vetter
  2019-08-14 12:49 ` [PATCH 2/2] RFC: drm/i915: Switch obj->mm.lock lockdep annotations on its head Daniel Vetter
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Daniel Vetter @ 2019-08-14 12:49 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Discussed this a bit with Chris, I think a comment here is warranted
that this will be bad once we have more than one i915 instance. And
lockdep won't catch it.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
index 74da35611d7c..70dc506a5426 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
@@ -135,6 +135,12 @@ userptr_mn_invalidate_range_start(struct mmu_notifier *_mn,
 			switch (mutex_trylock_recursive(unlock)) {
 			default:
 			case MUTEX_TRYLOCK_FAILED:
+				/*
+				 * NOTE: This only works because there's only
+				 * ever one i915-style struct_mutex in the
+				 * entire system. If we could have two i915
+				 * instances, this would deadlock.
+				 */
 				if (mutex_lock_killable_nested(unlock, I915_MM_SHRINKER)) {
 					i915_gem_object_put(obj);
 					return -EINTR;
-- 
2.22.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-08-16  7:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-14 12:49 [PATCH 1/2] drm/i915: Comment userptr recursion on struct_mutex Daniel Vetter
2019-08-14 12:49 ` [PATCH 2/2] RFC: drm/i915: Switch obj->mm.lock lockdep annotations on its head Daniel Vetter
2019-08-14 13:06   ` Chris Wilson
2019-08-14 14:48     ` Daniel Vetter
2019-08-14 18:49   ` [PATCH] " Daniel Vetter
2019-08-14 18:57     ` Chris Wilson
     [not found]       ` <20190815072301.GE7444@phenom.ffwll.local>
2019-08-15  7:28         ` Chris Wilson
2019-08-14 19:24   ` Daniel Vetter
2019-08-15 19:35     ` Tang, CQ
2019-08-16  7:28       ` Daniel Vetter
2019-08-14 14:36 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915: Comment userptr recursion on struct_mutex Patchwork
2019-08-14 14:58 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-08-14 19:22 ` [PATCH 1/2] " Daniel Vetter
2019-08-14 19:31 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915: Comment userptr recursion on struct_mutex (rev3) Patchwork
2019-08-14 20:06 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-15 11:55 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox