aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/i915/i915_utils.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-04-03 08:36:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-04-03 16:33:09 +0100
commitbfae03fe75eb8875396184bd3bf15a52bea04956 (patch)
tree452f869b18122bb73c6ecc1da31f5278f5cf2bc4 /drivers/gpu/drm/i915/i915_utils.c
parentdrm/i915: Keep a per-engine request pool (diff)
downloadwireguard-linux-bfae03fe75eb8875396184bd3bf15a52bea04956.tar.xz
wireguard-linux-bfae03fe75eb8875396184bd3bf15a52bea04956.zip
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 <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200403073657.13427-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_utils.c')
-rw-r--r--drivers/gpu/drm/i915/i915_utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_utils.c b/drivers/gpu/drm/i915/i915_utils.c
index 029854ae65fc..e28eae4a8f70 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);
}