Skip to content

Commit eef24f1

Browse files
tursulinjnikula
authored andcommitted
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: Tvrtko Ursulin <[email protected]> Fixes: 9b4d059 ("drm/i915: Request watchdog infrastructure") Cc: Daniel Vetter <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit f7c3797) Signed-off-by: Jani Nikula <[email protected]>
1 parent e65a4d3 commit eef24f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/i915/i915_request.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,15 @@ static void __rq_arm_watchdog(struct i915_request *rq)
350350
if (!ce->watchdog.timeout_us)
351351
return;
352352

353+
i915_request_get(rq);
354+
353355
hrtimer_init(&wdg->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
354356
wdg->timer.function = __rq_watchdog_expired;
355357
hrtimer_start_range_ns(&wdg->timer,
356358
ns_to_ktime(ce->watchdog.timeout_us *
357359
NSEC_PER_USEC),
358360
NSEC_PER_MSEC,
359361
HRTIMER_MODE_REL);
360-
i915_request_get(rq);
361362
}
362363

363364
static void __rq_cancel_watchdog(struct i915_request *rq)

0 commit comments

Comments
 (0)