After i915_active_unlock_wait i915_active can be still non-idle due to barrier async handling in signal_irq_work. As a result one can observe following errors: bcs0: heartbeat pulse did not flush idle tasks *ERROR* pulse active pulse_active [i915]:pulse_retire [i915] *ERROR* pulse count: 0 *ERROR* pulse preallocated barriers? no To prevent it let's wait explicitly for idleness. v2: wait only in live_idle tests Signed-off-by: Andrzej Hajda <andrzej.hajda@xxxxxxxxx> --- - Link to v1: https://lore.kernel.org/r/20231128-selftest_wait_for_active_idle_event-v1-1-e365cb8b2d87@xxxxxxxxx --- drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c index 273d440a53e3f4..bc441ce7b380d3 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c @@ -84,7 +84,7 @@ static struct pulse *pulse_create(void) static void pulse_unlock_wait(struct pulse *p) { - i915_active_unlock_wait(&p->active); + wait_var_event_timeout(&p->active, i915_active_is_idle(&p->active), HZ); } static int __live_idle_pulse(struct intel_engine_cs *engine, --- base-commit: f5e7a8caf6f5520ceb37c0e2e0d359a110c7cf98 change-id: 20231128-selftest_wait_for_active_idle_event-6bc728cd16a0 Best regards, -- Andrzej Hajda <andrzej.hajda@xxxxxxxxx>