Skip to content

Commit 2730055

Browse files
committed
drm/i915/gt: Always reset the engine, even if inactive, on execlists failure
If something has gone awry with the CSB processing, we need to pause, unwind and restart the request submission and event processing. However, currently we skip the engine reset if we raise an error but discover no active context, in the mistaken belief that it was merely a glitch in the matrix. The glitches are real enough, and we do need to unwind even if the engine appears idle (as it has gone permanently idle!) The simplest way to unwind and recover is simply do the engine reset, which should be very fast and _safe_ as nothing is active. Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 68172f2 commit 2730055

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,12 +3029,12 @@ static u32 active_ccid(struct intel_engine_cs *engine)
30293029
return ENGINE_READ_FW(engine, RING_EXECLIST_STATUS_HI);
30303030
}
30313031

3032-
static bool execlists_capture(struct intel_engine_cs *engine)
3032+
static void execlists_capture(struct intel_engine_cs *engine)
30333033
{
30343034
struct execlists_capture *cap;
30353035

30363036
if (!IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR))
3037-
return true;
3037+
return;
30383038

30393039
/*
30403040
* We need to _quickly_ capture the engine state before we reset.
@@ -3043,7 +3043,7 @@ static bool execlists_capture(struct intel_engine_cs *engine)
30433043
*/
30443044
cap = capture_regs(engine);
30453045
if (!cap)
3046-
return true;
3046+
return;
30473047

30483048
spin_lock_irq(&engine->active.lock);
30493049
cap->rq = active_context(engine, active_ccid(engine));
@@ -3080,14 +3080,13 @@ static bool execlists_capture(struct intel_engine_cs *engine)
30803080

30813081
INIT_WORK(&cap->work, execlists_capture_work);
30823082
schedule_work(&cap->work);
3083-
return true;
3083+
return;
30843084

30853085
err_rq:
30863086
i915_request_put(cap->rq);
30873087
err_free:
30883088
i915_gpu_coredump_put(cap->error);
30893089
kfree(cap);
3090-
return false;
30913090
}
30923091

30933092
static void execlists_reset(struct intel_engine_cs *engine, const char *msg)
@@ -3107,10 +3106,8 @@ static void execlists_reset(struct intel_engine_cs *engine, const char *msg)
31073106
tasklet_disable_nosync(&engine->execlists.tasklet);
31083107

31093108
ring_set_paused(engine, 1); /* Freeze the current request in place */
3110-
if (execlists_capture(engine))
3111-
intel_engine_reset(engine, msg);
3112-
else
3113-
ring_set_paused(engine, 0);
3109+
execlists_capture(engine);
3110+
intel_engine_reset(engine, msg);
31143111

31153112
tasklet_enable(&engine->execlists.tasklet);
31163113
clear_and_wake_up_bit(bit, lock);

0 commit comments

Comments
 (0)