All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/7] drm/i915: introduce i915_queue_hangcheck
Date: Wed,  3 Jul 2013 17:22:08 +0300	[thread overview]
Message-ID: <1372861332-6308-4-git-send-email-mika.kuoppala@intel.com> (raw)
In-Reply-To: <1372861332-6308-1-git-send-email-mika.kuoppala@intel.com>

From: Mika Kuoppala <mika.kuoppala@linux.intel.com>

To run hangcheck in near future.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_drv.h |    1 +
 drivers/gpu/drm/i915/i915_gem.c |    6 ++----
 drivers/gpu/drm/i915/i915_irq.c |   21 ++++++++++++---------
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8e73e3b..90cdd49 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1593,6 +1593,7 @@ extern void i915_update_gfx_val(struct drm_i915_private *dev_priv);
 extern void intel_console_resume(struct work_struct *work);
 
 /* i915_irq.c */
+void i915_queue_hangcheck(struct drm_device *dev);
 void i915_hangcheck_elapsed(unsigned long data);
 void i915_handle_error(struct drm_device *dev, bool wedged);
 
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 769f752..c5c90e3 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2082,10 +2082,8 @@ int __i915_add_request(struct intel_ring_buffer *ring,
 	ring->outstanding_lazy_request = 0;
 
 	if (!dev_priv->mm.suspended) {
-		if (i915_enable_hangcheck) {
-			mod_timer(&dev_priv->gpu_error.hangcheck_timer,
-				  round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES));
-		}
+		i915_queue_hangcheck(ring->dev);
+
 		if (was_empty) {
 			queue_delayed_work(dev_priv->wq,
 					   &dev_priv->mm.retire_work,
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 4c1b1e3..dc1b878 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -668,18 +668,13 @@ static void ironlake_handle_rps_change(struct drm_device *dev)
 static void notify_ring(struct drm_device *dev,
 			struct intel_ring_buffer *ring)
 {
-	struct drm_i915_private *dev_priv = dev->dev_private;
-
 	if (ring->obj == NULL)
 		return;
 
 	trace_i915_gem_request_complete(ring, ring->get_seqno(ring, false));
 
 	wake_up_all(&ring->irq_queue);
-	if (i915_enable_hangcheck) {
-		mod_timer(&dev_priv->gpu_error.hangcheck_timer,
-			  round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES));
-	}
+	i915_queue_hangcheck(dev);
 }
 
 static void gen6_pm_rps_work(struct work_struct *work)
@@ -2537,9 +2532,17 @@ void i915_hangcheck_elapsed(unsigned long data)
 	if (busy_count)
 		/* Reset timer case chip hangs without another request
 		 * being added */
-		mod_timer(&dev_priv->gpu_error.hangcheck_timer,
-			  round_jiffies_up(jiffies +
-					   DRM_I915_HANGCHECK_JIFFIES));
+		i915_queue_hangcheck(dev);
+}
+
+void i915_queue_hangcheck(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	if (!i915_enable_hangcheck)
+		return;
+
+	mod_timer(&dev_priv->gpu_error.hangcheck_timer,
+		  round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES));
 }
 
 static void ibx_irq_preinstall(struct drm_device *dev)
-- 
1.7.9.5

  parent reply	other threads:[~2013-07-03 14:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 14:22 [PATCH 0/7] Hangcheck and arb robustness Mika Kuoppala
2013-07-03 14:22 ` [PATCH 1/7] drm/i915: Fix retrieval of hangcheck stats Mika Kuoppala
2013-07-03 14:22 ` [PATCH 2/7] drm/i915: Replace open-coding of DEFAULT_CONTEXT_ID Mika Kuoppala
2013-07-03 14:22 ` Mika Kuoppala [this message]
2013-07-03 14:22 ` [PATCH 4/7] drm/i915: no hangcheck when reset is in progress Mika Kuoppala
2013-07-16  8:45   ` Daniel Vetter
2013-07-03 14:22 ` [PATCH 5/7] drm/i915: queue hangcheck on reset Mika Kuoppala
2013-07-16  8:49   ` Daniel Vetter
2013-07-16  9:16     ` Chris Wilson
2013-07-03 14:22 ` [PATCH 6/7] drm/i915: add i915_reset_count Mika Kuoppala
2013-07-03 14:22 ` [PATCH 7/7] drm/i915: add i915_get_reset_stats_ioctl Mika Kuoppala
2013-07-03 15:14   ` Chris Wilson
2013-07-03 21:23     ` Ben Widawsky
2013-07-03 21:41       ` Chris Wilson
2013-07-03 21:44         ` Ben Widawsky
2013-07-03 21:58           ` Daniel Vetter
2013-07-03 22:00             ` Ben Widawsky
2013-07-04  7:54               ` Ville Syrjälä
2013-07-04 16:39                 ` Ben Widawsky
2013-10-26  1:42   ` Ian Romanick
2013-10-27 12:30     ` Daniel Vetter
2013-10-29 22:29       ` Ian Romanick
2013-10-30  8:21         ` Daniel Vetter
2013-11-08  5:48           ` Dave Airlie
2013-11-08  6:32             ` Daniel Vetter
2013-11-08 17:21               ` Ian Romanick
2013-11-08 19:00                 ` Dave Airlie
2013-11-08 21:20                   ` Ian Romanick
2013-11-08 19:22               ` Jesse Barnes

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=1372861332-6308-4-git-send-email-mika.kuoppala@intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.