Skip to content

Commit ce7743b

Browse files
NitinGoterodrigovivi
authored andcommitted
drm/i915/gt: Add delay to let engine resumes properly
Sometimes engine reset fails because the engine resumes from an incorrect RING_HEAD. Engine head failed to set to zero even after writing into it. This is a timing issue and we experimented different values and found out that 20ms delay works best based on testing. So, add a 20ms delay to let engine resumes from correct RING_HEAD. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13968 Signed-off-by: Nitin Gote <[email protected]> Reviewed-by: Sebastian Brzezinka <[email protected]> Reviewed-by: Krzysztof Karas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 795dbde commit ce7743b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,13 @@ static void reset_prepare(struct intel_engine_cs *engine)
365365
ENGINE_READ_FW(engine, RING_HEAD),
366366
ENGINE_READ_FW(engine, RING_TAIL),
367367
ENGINE_READ_FW(engine, RING_START));
368-
if (!stop_ring(engine)) {
368+
/*
369+
* Sometimes engine head failed to set to zero even after writing into it.
370+
* Use wait_for_atomic() with 20ms delay to let engine resumes from
371+
* correct RING_HEAD. Experimented different values and determined
372+
* that 20ms works best based on testing.
373+
*/
374+
if (wait_for_atomic((!stop_ring(engine) == 0), 20)) {
369375
drm_err(&engine->i915->drm,
370376
"failed to set %s head to zero "
371377
"ctl %08x head %08x tail %08x start %08x\n",

0 commit comments

Comments
 (0)