Re: [PATCH] drm/i915: Only call mod_timer() if not already pending

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 20, 2014 at 08:10:33PM +0000, Chris Wilson wrote:
> The final arrangement of updating timer->expires and calling mod_timer()
> used in
> 
> commit 672e7b7c1849c904b2c55185906b3940843c55c6
> Author: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
> ---
>  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));

Oops. And that one now is before the merge, so no history rectifying.

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux