All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Don't unwedge if reset is disabled
@ 2019-09-05  9:09 Janusz Krzysztofik
  2019-09-05  9:43 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Janusz Krzysztofik @ 2019-09-05  9:09 UTC (permalink / raw)
  To: Chris Wilson, Daniele Ceraolo Spurio, Tvrtko Ursulin; +Cc: intel-gfx

When trying to reset a device with reset capability disabled or not
supported while rings are full of requests, it has been observed when
running in execlists submission mode that command stream buffer tail
tends to be incremented by apparently still running GPU regardless of
all requests being already cancelled and command stream buffer pointers
reset.  As a result, kernel panic on NULL pointer dereference occurs
when a trace_ports() helper is called with command stream buffer tail
incremented but request pointers being NULL during final
__intel_gt_set_wedged() operation called from intel_gt_reset().

Skip actual reset procedure if reset is disabled or not supported.

Suggested-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_reset.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
index b9d84d52e986..d75da124e280 100644
--- a/drivers/gpu/drm/i915/gt/intel_reset.c
+++ b/drivers/gpu/drm/i915/gt/intel_reset.c
@@ -932,25 +932,35 @@ void intel_gt_reset(struct intel_gt *gt,
 	GEM_BUG_ON(!test_bit(I915_RESET_BACKOFF, &gt->reset.flags));
 	mutex_lock(&gt->reset.mutex);
 
-	/* Clear any previous failed attempts at recovery. Time to try again. */
-	if (!__intel_gt_unset_wedged(gt))
-		goto unlock;
-
 	if (reason)
 		dev_notice(gt->i915->drm.dev,
 			   "Resetting chip for %s\n", reason);
-	atomic_inc(&gt->i915->gpu_error.reset_count);
-
-	awake = reset_prepare(gt);
 
 	if (!intel_has_gpu_reset(gt->i915)) {
 		if (i915_modparams.reset)
 			dev_err(gt->i915->drm.dev, "GPU reset not supported\n");
 		else
 			DRM_DEBUG_DRIVER("GPU reset disabled\n");
-		goto error;
+
+		/*
+		 * Don't unwedge if reset is disabled or not supported
+		 * because we can't guarantee what the hardware status is.
+		 */
+		if (intel_gt_is_wedged(gt))
+			goto unlock;
 	}
 
+	/* Clear any previous failed attempts at recovery. Time to try again. */
+	if (!__intel_gt_unset_wedged(gt))
+		goto unlock;
+
+	atomic_inc(&gt->i915->gpu_error.reset_count);
+
+	awake = reset_prepare(gt);
+
+	if (!intel_has_gpu_reset(gt->i915))
+		goto error;
+
 	if (INTEL_INFO(gt->i915)->gpu_reset_clobbers_display)
 		intel_runtime_pm_disable_interrupts(gt->i915);
 
-- 
2.21.0

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

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

end of thread, other threads:[~2019-09-13 14:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05  9:09 [PATCH] drm/i915: Don't unwedge if reset is disabled Janusz Krzysztofik
2019-09-05  9:43 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-09-05 10:50 ` ✓ Fi.CI.IGT: " Patchwork
2019-09-06 22:28 ` [PATCH] " Daniele Ceraolo Spurio
2019-09-07  8:39   ` Chris Wilson
2019-09-09 16:27     ` Daniele Ceraolo Spurio
2019-09-09 21:45       ` Chris Wilson
2019-09-09 21:48     ` Chris Wilson
2019-09-13 14:20       ` Janusz Krzysztofik

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.