[Intel-gfx] [PATCH] drm/i915/selftests: wait for active idle event in i915_active_unlock_wait

Andrzej Hajda andrzej.hajda at intel.com
Tue Nov 28 11:49:27 UTC 2023


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.

Signed-off-by: Andrzej Hajda <andrzej.hajda at intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_active.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c
index b61fe850e92493..c7dd12624f3485 100644
--- a/drivers/gpu/drm/i915/selftests/i915_active.c
+++ b/drivers/gpu/drm/i915/selftests/i915_active.c
@@ -342,6 +342,9 @@ void i915_active_unlock_wait(struct i915_active *ref)
 		rcu_read_unlock();
 
 		i915_active_release(ref);
+
+		___wait_var_event(ref, i915_active_is_idle(ref),
+				  TASK_INTERRUPTIBLE, 0, 0, schedule());
 	}
 
 	/* And wait for the retire callback */

---
base-commit: f5e7a8caf6f5520ceb37c0e2e0d359a110c7cf98
change-id: 20231128-selftest_wait_for_active_idle_event-6bc728cd16a0

Best regards,
-- 
Andrzej Hajda <andrzej.hajda at intel.com>



More information about the Intel-gfx mailing list