Skip to content

Commit eb927f0

Browse files
drm/i915/gt: Restart the heartbeat timer when forcing a pulse
The context persistence code does things like send super high priority heartbeat pulses to ensure any leaked context can still be pre-empted and thus isn't a total denial of service but only a minor denial of service. Unfortunately, it wasn't bothering to restart the heartbeat worker with a fresh timeout. Thus, if a persistent context happened to be closed just before the heartbeat was going to go ping anyway then the forced pulse would get a negligble execution time. And as the forced pulse is super high priority, the worker thread's next step is a reset. Which means a potentially innocent system randomly goes boom when attempting to close a context. So, force a re-schedule of the worker thread with the appropriate timeout. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240110210216.4125092-1-John.C.Harrison@Intel.com
1 parent b112364 commit eb927f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ static int __intel_engine_pulse(struct intel_engine_cs *engine)
290290
heartbeat_commit(rq, &attr);
291291
GEM_BUG_ON(rq->sched.attr.priority < I915_PRIORITY_BARRIER);
292292

293+
/* Ensure the forced pulse gets a full period to execute */
294+
next_heartbeat(engine);
295+
293296
return 0;
294297
}
295298

0 commit comments

Comments
 (0)