提交 eef24f11 编写于 作者: T Tvrtko Ursulin 提交者: Jani Nikula

drm/i915: Take request reference before arming the watchdog timer

Reference needs to be taken before arming the timer. Luckily, given the
default timer period of 20s, the potential to hit the race is extremely
unlikely.
Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 9b4d0598 ("drm/i915: Request watchdog infrastructure")
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210326105759.2387104-1-tvrtko.ursulin@linux.intel.com
(cherry picked from commit f7c37977)
Signed-off-by: NJani Nikula <jani.nikula@intel.com>
上级 e65a4d37
...@@ -350,6 +350,8 @@ static void __rq_arm_watchdog(struct i915_request *rq) ...@@ -350,6 +350,8 @@ static void __rq_arm_watchdog(struct i915_request *rq)
if (!ce->watchdog.timeout_us) if (!ce->watchdog.timeout_us)
return; return;
i915_request_get(rq);
hrtimer_init(&wdg->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); hrtimer_init(&wdg->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
wdg->timer.function = __rq_watchdog_expired; wdg->timer.function = __rq_watchdog_expired;
hrtimer_start_range_ns(&wdg->timer, hrtimer_start_range_ns(&wdg->timer,
...@@ -357,7 +359,6 @@ static void __rq_arm_watchdog(struct i915_request *rq) ...@@ -357,7 +359,6 @@ static void __rq_arm_watchdog(struct i915_request *rq)
NSEC_PER_USEC), NSEC_PER_USEC),
NSEC_PER_MSEC, NSEC_PER_MSEC,
HRTIMER_MODE_REL); HRTIMER_MODE_REL);
i915_request_get(rq);
} }
static void __rq_cancel_watchdog(struct i915_request *rq) static void __rq_cancel_watchdog(struct i915_request *rq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册