mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
drm/i915/gt: Add a safety submission flush in the heartbeat
Just in case everything fails (like for example "missed interrupt syndrome" on Sandybridge), always flush the submission tasklet from the heartbeat. This papers over such issues, but will still appear as a second long glitch, and prevents us from detecting it unless we happen to be performing a timed test. v2: We rely on flush_submission() synchronizing with the tasklet on another CPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200615165013.22973-3-chris@chris-wilson.co.uk
This commit is contained in:
parent
f2e85e5736
commit
5948938700
@ -1094,19 +1094,18 @@ void intel_engine_flush_submission(struct intel_engine_cs *engine)
|
||||
{
|
||||
struct tasklet_struct *t = &engine->execlists.tasklet;
|
||||
|
||||
if (__tasklet_is_scheduled(t)) {
|
||||
local_bh_disable();
|
||||
if (tasklet_trylock(t)) {
|
||||
/* Must wait for any GPU reset in progress. */
|
||||
if (__tasklet_is_enabled(t))
|
||||
t->func(t->data);
|
||||
tasklet_unlock(t);
|
||||
}
|
||||
local_bh_enable();
|
||||
}
|
||||
/* Synchronise and wait for the tasklet on another CPU */
|
||||
tasklet_kill(t);
|
||||
|
||||
/* Otherwise flush the tasklet if it was running on another cpu */
|
||||
tasklet_unlock_wait(t);
|
||||
/* Having cancelled the tasklet, ensure that is run */
|
||||
local_bh_disable();
|
||||
if (tasklet_trylock(t)) {
|
||||
/* Must wait for any GPU reset in progress. */
|
||||
if (__tasklet_is_enabled(t))
|
||||
t->func(t->data);
|
||||
tasklet_unlock(t);
|
||||
}
|
||||
local_bh_enable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,6 +65,9 @@ static void heartbeat(struct work_struct *wrk)
|
||||
struct intel_context *ce = engine->kernel_context;
|
||||
struct i915_request *rq;
|
||||
|
||||
/* Just in case everything has gone horribly wrong, give it a kick */
|
||||
intel_engine_flush_submission(engine);
|
||||
|
||||
rq = engine->heartbeat.systole;
|
||||
if (rq && i915_request_completed(rq)) {
|
||||
i915_request_put(rq);
|
||||
|
Loading…
Reference in New Issue
Block a user