[Intel-gfx] [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 22 12:53:30 CET 2013


As a precaution against the driver fouling up and missing a hang leaving
the caller in an indefinite wait, manually inspect for a GPU hang if we
timeout whilst waiting for a seqno.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0d878c1..54bb921 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1129,6 +1129,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 		else
 			end = wait_event_timeout(ring->irq_queue, EXIT_COND,
 						 timeout_jiffies);
+		/* Be paranoid and check that we haven't missed a GPU hang */
+		if (end == 0)
+			i915_hangcheck_elapsed((unsigned long)dev_priv->dev);
 
 		/* We need to check whether any gpu reset happened in between
 		 * the caller grabbing the seqno and now ... */
-- 
1.7.10.4




More information about the Intel-gfx mailing list