diff options
author | Chris Wilson <[email protected]> | 2014-11-19 09:47:19 +0000 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2014-11-19 11:44:50 +0100 |
commit | 672e7b7c1849c904b2c55185906b3940843c55c6 (patch) | |
tree | 0fa877be4ee85371dbba03d51bd63c8ccf067867 | |
parent | 77c1aa84de0096792de673aa1c64c36b38553cf5 (diff) |
drm/i915: Don't continually defer the hangcheck
With multiple rings, we may continue to render on the blitter whilst
executing an infinite shader on the render ring. As we currently, rearm
the timer with each execbuf, in this scenario the hangcheck will never
fire and we will never detect the lockup on the render ring. Instead,
only arm the timer once per hangcheck, so that hangcheck runs more
frequently.
v2: Rearrange code to avoid triggering a BUG_ON in add_timer from
softirq context.
Testcase: igt/gem_reset_stats/defer-hangcheck*
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86225
Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Reviewed-by: Mika Kuoppala <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 5e5d3f709f0f..e298518c944e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -988,7 +988,6 @@ static void notify_ring(struct drm_device *dev, trace_i915_gem_request_complete(ring); wake_up_all(&ring->irq_queue); - i915_queue_hangcheck(dev); } static u32 vlv_c0_residency(struct drm_i915_private *dev_priv, @@ -3041,11 +3040,15 @@ static void i915_hangcheck_elapsed(unsigned long data) void i915_queue_hangcheck(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; + struct timer_list *timer = &dev_priv->gpu_error.hangcheck_timer; + if (!i915.enable_hangcheck) return; - mod_timer(&dev_priv->gpu_error.hangcheck_timer, - round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES)); + /* Don't continually defer the hangcheck, but make sure it is active */ + if (!timer_pending(timer)) + timer->expires = round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES); + mod_timer(timer, timer->expires); } static void ibx_irq_reset(struct drm_device *dev) |