All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/i915: Refine placement of gt.reset_lockmap
@ 2019-06-13  6:20 Chris Wilson
  2019-06-13  6:20 ` [PATCH 2/4] drm/i915: Avoid tainting i915_gem_park() with wakeref.lock Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Chris Wilson @ 2019-06-13  6:20 UTC (permalink / raw)
  To: intel-gfx

If we pull the lockmap into reset_prepare/reset_finish, it will
naturally cover i915_gem_set_wedged() as well as i915_reset(). And with
another tweak, we can pull __i915_gem_unset_wedged() underneath the
lockmap covering the mutexes used there.

As a bonus, it should hide the ugliness of the i915_reset exit path ;)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_reset.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
index 6368b37f26d1..952e11b4b5c5 100644
--- a/drivers/gpu/drm/i915/gt/intel_reset.c
+++ b/drivers/gpu/drm/i915/gt/intel_reset.c
@@ -723,6 +723,8 @@ static void reset_prepare(struct drm_i915_private *i915)
 	enum intel_engine_id id;
 
 	intel_gt_pm_get(i915);
+	lock_map_acquire(&i915->gt.reset_lockmap);
+
 	for_each_engine(engine, i915, id)
 		reset_prepare_engine(engine);
 
@@ -773,6 +775,8 @@ static void reset_finish(struct drm_i915_private *i915)
 		reset_finish_engine(engine);
 		intel_engine_signal_breadcrumbs(engine);
 	}
+
+	lock_map_release(&i915->gt.reset_lockmap);
 	intel_gt_pm_put(i915);
 }
 
@@ -978,17 +982,17 @@ void i915_reset(struct drm_i915_private *i915,
 
 	might_sleep();
 	GEM_BUG_ON(!test_bit(I915_RESET_BACKOFF, &error->flags));
-	lock_map_acquire(&i915->gt.reset_lockmap);
+
+	reset_prepare(i915);
 
 	/* Clear any previous failed attempts at recovery. Time to try again. */
 	if (!__i915_gem_unset_wedged(i915))
-		goto unlock;
+		goto finish;
 
 	if (reason)
 		dev_notice(i915->drm.dev, "Resetting chip for %s\n", reason);
 	error->reset_count++;
 
-	reset_prepare(i915);
 
 	if (!intel_has_gpu_reset(i915)) {
 		if (i915_modparams.reset)
@@ -1030,8 +1034,6 @@ void i915_reset(struct drm_i915_private *i915,
 
 finish:
 	reset_finish(i915);
-unlock:
-	lock_map_release(&i915->gt.reset_lockmap);
 	return;
 
 taint:
-- 
2.20.1

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

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

end of thread, other threads:[~2019-06-13  7:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13  6:20 [PATCH 1/4] drm/i915: Refine placement of gt.reset_lockmap Chris Wilson
2019-06-13  6:20 ` [PATCH 2/4] drm/i915: Avoid tainting i915_gem_park() with wakeref.lock Chris Wilson
2019-06-13  6:20 ` [PATCH 3/4] drm/i915: Move fence register tracking from i915->mm to ggtt Chris Wilson
2019-06-13  6:20 ` [PATCH 4/4] drm/i915: Track ggtt fence reservations under its own mutex Chris Wilson
2019-06-13  6:47 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Refine placement of gt.reset_lockmap Patchwork
2019-06-13  7:10 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-13  7:15   ` Chris Wilson
2019-06-13  7:19     ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.