From: Chris Wilson Date: Fri, 3 Apr 2020 07:36:57 +0000 (+0100) Subject: drm/i915: Avoid setting timer->expires to 0 X-Git-Tag: v5.8-rc1~194^2~18^2~60 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bfae03fe75eb8875396184bd3bf15a52bea04956;p=users%2Fjedix%2Flinux-maple.git drm/i915: Avoid setting timer->expires to 0 We use timer->expires == 0 to detect if a timer had been cancelled, but it's a valid expiration we could set. Just skip using 0 and set the expiry for the next jiffie. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200403073657.13427-1-chris@chris-wilson.co.uk --- diff --git a/drivers/gpu/drm/i915/i915_utils.c b/drivers/gpu/drm/i915/i915_utils.c index 029854ae65fc7..e28eae4a8f706 100644 --- a/drivers/gpu/drm/i915/i915_utils.c +++ b/drivers/gpu/drm/i915/i915_utils.c @@ -101,5 +101,6 @@ void set_timer_ms(struct timer_list *t, unsigned long timeout) */ barrier(); - mod_timer(t, jiffies + timeout); + /* Keep t->expires = 0 reserved to indicate a canceled timer. */ + mod_timer(t, jiffies + timeout ?: 1); }