[Intel-gfx] [PATCH 1/2] drm/i915: increase GPU wedging timeout

Mika Kuoppala mika.kuoppala at linux.intel.com
Fri Aug 23 15:57:28 CEST 2013


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 at 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(-)

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. */
-- 
1.7.9.5




More information about the Intel-gfx mailing list