Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Shortcut readiness to reset check
@ 2019-04-12 16:16 Mika Kuoppala
  2019-04-12 16:16 ` [PATCH 2/2] drm/i915: Handle catastrophic error on engine reset Mika Kuoppala
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mika Kuoppala @ 2019-04-12 16:16 UTC (permalink / raw)
  To: intel-gfx

If the engine says it is ready for reset, it is ready
so avoid further dancing and proceed.

v2: reg (Chris)

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

diff --git a/drivers/gpu/drm/i915/i915_reset.c b/drivers/gpu/drm/i915/i915_reset.c
index 68875ba43b8d..d874a62103e5 100644
--- a/drivers/gpu/drm/i915/i915_reset.c
+++ b/drivers/gpu/drm/i915/i915_reset.c
@@ -490,14 +490,20 @@ static int gen11_reset_engines(struct drm_i915_private *i915,
 static int gen8_engine_reset_prepare(struct intel_engine_cs *engine)
 {
 	struct intel_uncore *uncore = engine->uncore;
+	const i915_reg_t reg = RING_RESET_CTL(engine->mmio_base);
+	u32 ctl;
 	int ret;
 
+	ctl = intel_uncore_read_fw(uncore, reg);
+	if (ctl & RESET_CTL_READY_TO_RESET)
+		return 0;
+
 	intel_uncore_write_fw(uncore,
-			      RING_RESET_CTL(engine->mmio_base),
+			      reg,
 			      _MASKED_BIT_ENABLE(RESET_CTL_REQUEST_RESET));
 
 	ret = __intel_wait_for_register_fw(uncore,
-					   RING_RESET_CTL(engine->mmio_base),
+					   reg,
 					   RESET_CTL_READY_TO_RESET,
 					   RESET_CTL_READY_TO_RESET,
 					   700, 0,
-- 
2.17.1

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

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

end of thread, other threads:[~2019-04-12 20:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-12 16:16 [PATCH 1/2] drm/i915: Shortcut readiness to reset check Mika Kuoppala
2019-04-12 16:16 ` [PATCH 2/2] drm/i915: Handle catastrophic error on engine reset Mika Kuoppala
2019-04-12 16:24   ` Chris Wilson
2019-04-12 16:53     ` Mika Kuoppala
2019-04-12 16:56       ` Chris Wilson
2019-04-12 16:21 ` [PATCH 1/2] drm/i915: Shortcut readiness to reset check Chris Wilson
2019-04-12 16:53   ` Mika Kuoppala
2019-04-12 16:45 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
2019-04-12 18:01 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Shortcut readiness to reset check (rev3) Patchwork
2019-04-12 20:24 ` ✓ 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