diff mbox

[1/2] drm/i915: increase GPU wedging timeout

Message ID 1377266249-16854-1-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Aug. 23, 2013, 1:57 p.m. UTC
Currently our wedge timeout is 5 seconds. Hangcheck
needs atleast three runs to declare a hang with 1500ms
timer tick period.

To make sure that gpu can be wedged in the first place,
define wedge timeout as multiple of hangcheck timer periods to ensure
that it is always greater than hang detection time.

This commit increases wedging period from 5 seconds to 8 seconds.

v2: better name for macro (Chris Wilson)

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c |    3 ++-
 drivers/gpu/drm/i915/i915_drv.h |    3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Mika Kuoppala Aug. 28, 2013, 8:24 a.m. UTC | #1
Mika Kuoppala <mika.kuoppala@linux.intel.com> writes:

> Currently our wedge timeout is 5 seconds. Hangcheck
> needs atleast three runs to declare a hang with 1500ms
> timer tick period.
>
> To make sure that gpu can be wedged in the first place,
> define wedge timeout as multiple of hangcheck timer periods to ensure
> that it is always greater than hang detection time.
>
> This commit increases wedging period from 5 seconds to 8 seconds.
>
> v2: better name for macro (Chris Wilson)

Forget both of these. I will post an improved series soon.
-Mika
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index beb2956..e19dec5 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -815,7 +815,8 @@  int i915_reset(struct drm_device *dev)
 
 	simulated = dev_priv->gpu_error.stop_rings != 0;
 
-	if (!simulated && get_seconds() - dev_priv->gpu_error.last_reset < 5) {
+	if (!simulated && get_seconds() - dev_priv->gpu_error.last_reset <
+	    DRM_I915_WEDGE_PERIOD) {
 		DRM_ERROR("GPU hanging too fast, declaring wedged!\n");
 		ret = -ENODEV;
 	} else {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 5f8a638..9c0ca78 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -976,6 +976,9 @@  struct i915_gpu_error {
 	/* For hangcheck timer */
 #define DRM_I915_HANGCHECK_PERIOD 1500 /* in ms */
 #define DRM_I915_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD)
+	/* Hangcheck needs >2 periods to declare a hang */
+#define DRM_I915_WEDGE_PERIOD DIV_ROUND_UP(5*DRM_I915_HANGCHECK_PERIOD, 1000)
+
 	struct timer_list hangcheck_timer;
 
 	/* For reset and error_state handling. */