drm/i915: Mark up nested spinlocks

Submitted by Chris Wilson on May 12, 2018, 8:49 a.m.

Details

Message ID 20180512084957.9829-1-chris@chris-wilson.co.uk
State Accepted
Commit 0c591a40af1b369cc11dce4d558dd71bebbdc090
Headers show
Series "drm/i915: Mark up nested spinlocks" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Chris Wilson May 12, 2018, 8:49 a.m.
When we process the outstanding requests upon banning a context, we need
to acquire both the engine and the client's timeline, nesting the locks.
This requires explicit markup as the two timelines are now of the same
class, since commit a89d1f921c15 ("drm/i915: Split i915_gem_timeline into
individual timelines").

Testcase: igt/gem_eio/banned
Fixes: a89d1f921c15 ("drm/i915: Split i915_gem_timeline into individual timelines")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 89bf5d67cb74..0a2070112b66 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3119,7 +3119,7 @@  static void engine_skip_context(struct i915_request *request)
 	GEM_BUG_ON(timeline == &engine->timeline);
 
 	spin_lock_irqsave(&engine->timeline.lock, flags);
-	spin_lock(&timeline->lock);
+	spin_lock_nested(&timeline->lock, SINGLE_DEPTH_NESTING);
 
 	list_for_each_entry_continue(request, &engine->timeline.requests, link)
 		if (request->ctx == hung_ctx)

Comments

Quoting Chris Wilson (2018-05-12 09:49:57)
> When we process the outstanding requests upon banning a context, we need
> to acquire both the engine and the client's timeline, nesting the locks.
> This requires explicit markup as the two timelines are now of the same
> class, since commit a89d1f921c15 ("drm/i915: Split i915_gem_timeline into
> individual timelines").
> 
> Testcase: igt/gem_eio/banned
> Fixes: a89d1f921c15 ("drm/i915: Split i915_gem_timeline into individual timelines")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Michel Thierry <michel.thierry@intel.com>

[from resend]
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-Chris
Quoting Chris Wilson (2018-05-14 11:43:44)
> Quoting Chris Wilson (2018-05-12 09:49:57)
> > When we process the outstanding requests upon banning a context, we need
> > to acquire both the engine and the client's timeline, nesting the locks.
> > This requires explicit markup as the two timelines are now of the same
> > class, since commit a89d1f921c15 ("drm/i915: Split i915_gem_timeline into
> > individual timelines").
> > 
> > Testcase: igt/gem_eio/banned
> > Fixes: a89d1f921c15 ("drm/i915: Split i915_gem_timeline into individual timelines")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Michel Thierry <michel.thierry@intel.com>
> 
> [from resend]
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And pushed, thanks for the review. Will push the test case once CI has
updated to the new drm-tip.
-Chris