All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915/gt: Do not destroy uninitialized timer
@ 2026-10-01  7:17 Krzysztof Karas
  2026-10-01  8:08 ` Jani Nikula
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Krzysztof Karas @ 2026-10-01  7:17 UTC (permalink / raw)
  To: intel-gfx
  Cc: Jani Nikula, Andi Shyti, Janusz Krzysztofik, Sebastian Brzezinka,
	Krzysztof Niemiec, Krzysztof Karas

If intel_ring_begin() fails in live_emit_pte_full_ring(), then
cleanup is performed on an uninitialized timer.

Prevent that by jumping to a dedicated label for driver removal
cleanup.

Assisted-by: Copilot-Claude-Opus-5
Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_migrate.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c
index 5b986a7687d9..5e3a9b5a83eb 100644
--- a/drivers/gpu/drm/i915/gt/selftest_migrate.c
+++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c
@@ -651,17 +651,18 @@ static int live_emit_pte_full_ring(void *arg)
 	len = emit_pte(rq, &it, obj->pat_index, false, 0, CHUNK_SZ);
 	if (!len) {
 		err = -EINVAL;
-		goto out_rq;
+		goto out_timer;
 	}
 	if (len < 0) {
 		err = len;
-		goto out_rq;
+		goto out_timer;
 	}
 
-out_rq:
-	i915_request_add(rq); /* GEM_BUG_ON(rq->reserved_space > ring->space)? */
+out_timer:
 	timer_delete_sync(&st.timer);
 	timer_destroy_on_stack(&st.timer);
+out_rq:
+	i915_request_add(rq); /* GEM_BUG_ON(rq->reserved_space > ring->space)? */
 out_unpin:
 	intel_context_unpin(ce);
 out_put:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-02 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01  7:17 [PATCH v2] drm/i915/gt: Do not destroy uninitialized timer Krzysztof Karas
2026-10-01  8:08 ` Jani Nikula
2026-10-01 10:07 ` ✓ i915.CI.BAT: success for drm/i915/gt: Do not destroy uninitialized timer (rev2) Patchwork
2026-10-01 12:06 ` [PATCH v2] drm/i915/gt: Do not destroy uninitialized timer Sebastian Brzezinka
2026-10-02 11:55 ` ✓ i915.CI.Full: success for drm/i915/gt: Do not destroy uninitialized timer (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.