All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Only call mod_timer() if not already pending
@ 2014-11-20 20:10 Chris Wilson
  2014-11-20 21:49 ` Daniel Vetter
  2014-11-22 20:20 ` [PATCH] drm/i915: Only call mod_timer() if not already shuang.he
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2014-11-20 20:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: Mika Kuoppala

The final arrangement of updating timer->expires and calling mod_timer()
used in

commit 672e7b7c1849c904b2c55185906b3940843c55c6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Nov 19 09:47:19 2014 +0000

    drm/i915: Don't continually defer the hangcheck

turns out to be very unsafe. Try again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 8d169e152d1e..5908580d7c15 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3067,9 +3067,10 @@ void i915_queue_hangcheck(struct drm_device *dev)
 		return;
 
 	/* 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);
+	if (timer_pending(timer))
+		return;
+	mod_timer(timer,
+		  round_jiffies_up(jiffies + DRM_I915_HANGCHECK_JIFFIES));
 }
 
 static void ibx_irq_reset(struct drm_device *dev)
-- 
2.1.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-22 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20 20:10 [PATCH] drm/i915: Only call mod_timer() if not already pending Chris Wilson
2014-11-20 21:49 ` Daniel Vetter
2014-11-22 20:20 ` [PATCH] drm/i915: Only call mod_timer() if not already shuang.he

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.