[Intel-gfx] [PATCH] drm/i915: Allow unready gpu to be reset on gen8

Mika Kuoppala mika.kuoppala at linux.intel.com
Mon Nov 2 01:25:08 PST 2015


Gen9 has had demonstrated cases where forcing a not ready gpu
into reset has caused system hang [1].

Gen8 has never to this date demonstrated such behaviour.

In our CI tests there have been two cases of bsw ending in a state
where it claims it is not ready for reset, based on reset request,
after gpu hang [2]. Both of these cases have happened with kernel
where there are lots of debugs enabled. So it is possible that
something timing related is at play here like that wait_for_register()
usleep wakeups collide badly with forcewake.

If we assume that gen8 is safe to reset even with claims of nonreadiness,
we can alleviate this situations by forcing a reset and revive the gpu.
Enhance logging so that it will be clear what conditions led to decision
of proceeding or bailing out, so that we will spot if this way of forcing
our will against gpu turns out to be foolhardy.

v2: - add bugzilla entry for bsw behaviour (Chris)
    - improve commit message

References [1]: https://bugs.freedesktop.org/show_bug.cgi?id=89959
References [2]: https://bugs.freedesktop.org/show_bug.cgi?id=92774
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Tomi Sarvela <tomix.p.sarvela at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index f0f97b2..47c17f2 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1504,7 +1504,14 @@ not_ready:
 		I915_WRITE(RING_RESET_CTL(engine->mmio_base),
 			   _MASKED_BIT_DISABLE(RESET_CTL_REQUEST_RESET));
 
-	return -EIO;
+	if (INTEL_INFO(dev)->gen == 9) {
+		DRM_ERROR("Reset would risk system stability, bailing out\n");
+		return -EIO;
+	}
+
+	DRM_ERROR("Forcing non ready gpu into reset\n");
+
+	return gen6_do_reset(dev);
 }
 
 static int (*intel_get_gpu_reset(struct drm_device *dev))(struct drm_device *)
-- 
2.5.0



More information about the Intel-gfx mailing list