All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: ben@bwidawsk.net, miku@iki.fi
Subject: [PATCH 3/5] drm/i915: introduce i915_hangcheck_ring_hung
Date: Mon, 13 May 2013 16:32:11 +0300	[thread overview]
Message-ID: <1368451933-32571-3-git-send-email-mika.kuoppala@intel.com> (raw)
In-Reply-To: <1368451933-32571-1-git-send-email-mika.kuoppala@intel.com>

In preparation to track per ring progress in hangcheck,
add i915_hangcheck_ring_hung.

v2: omit dev parameter (Ben Widawsky)

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c |   29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 004ad34..6efe3b0 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2345,28 +2345,33 @@ static bool kick_ring(struct intel_ring_buffer *ring)
 	return false;
 }
 
+static bool i915_hangcheck_ring_hung(struct intel_ring_buffer *ring)
+{
+	if (IS_GEN2(ring->dev))
+		return false;
+
+	/* Is the chip hanging on a WAIT_FOR_EVENT?
+	 * If so we can simply poke the RB_WAIT bit
+	 * and break the hang. This should work on
+	 * all but the second generation chipsets.
+	 */
+	return !kick_ring(ring);
+}
+
 static bool i915_hangcheck_hung(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
 	if (dev_priv->gpu_error.hangcheck_count++ > 1) {
 		bool hung = true;
+		struct intel_ring_buffer *ring;
+		int i;
 
 		DRM_ERROR("Hangcheck timer elapsed... GPU hung\n");
 		i915_handle_error(dev, true);
 
-		if (!IS_GEN2(dev)) {
-			struct intel_ring_buffer *ring;
-			int i;
-
-			/* Is the chip hanging on a WAIT_FOR_EVENT?
-			 * If so we can simply poke the RB_WAIT bit
-			 * and break the hang. This should work on
-			 * all but the second generation chipsets.
-			 */
-			for_each_ring(ring, dev_priv, i)
-				hung &= !kick_ring(ring);
-		}
+		for_each_ring(ring, dev_priv, i)
+			hung &= i915_hangcheck_ring_hung(ring);
 
 		return hung;
 	}
-- 
1.7.9.5

  parent reply	other threads:[~2013-05-13 13:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 13:32 [PATCH 1/5] drm/i915: pass seqno to i915_hangcheck_ring_idle Mika Kuoppala
2013-05-13 13:32 ` [PATCH 2/5] drm/i915: track ring progression using seqnos Mika Kuoppala
2013-05-17 17:40   ` Ben Widawsky
2013-05-24 14:16     ` [PATCH 02/14] " Mika Kuoppala
2013-05-13 13:32 ` Mika Kuoppala [this message]
2013-05-24 18:26   ` [PATCH 3/5] drm/i915: introduce i915_hangcheck_ring_hung Ben Widawsky
2013-05-25 11:26     ` Daniel Vetter
2013-05-13 13:32 ` [PATCH 4/5] drm/i915: detect hang using per ring hangcheck_score Mika Kuoppala
2013-05-27  1:34   ` Ben Widawsky
2013-05-27 17:42     ` Mika Kuoppala
2013-05-30  6:04     ` [PATCH] " Mika Kuoppala
2013-05-13 13:32 ` [PATCH 5/5] drm/i915: remove i915_hangcheck_hung Mika Kuoppala
2013-05-29 17:48   ` Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368451933-32571-3-git-send-email-mika.kuoppala@intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=miku@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.