All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe/survivability: Fix infinite loop in aux info traversal
@ 2026-11-19 10:43 Sk Anirban
  2026-11-19 11:04 ` sashiko-bot
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sk Anirban @ 2026-11-19 10:43 UTC (permalink / raw)
  To: intel-xe
  Cc: anshuman.gupta, badal.nilawar, riana.tauro, karthik.poosa,
	raag.jadav, soham.purkait, mallesh.koujalagi, Sk Anirban

AUX info register traversal can loop indefinitely when a register
points back to itself. Avoid revisiting registers by reading each
register once and collecting the entries that contain data.

v2: Add fixes (Riana)
    Modify loop (Riana)

Fixes: 5e940312a2ac ("drm/xe: Add functions and sysfs for boot survivability")
Signed-off-by: Sk Anirban <sk.anirban@intel.com>
---
 drivers/gpu/drm/xe/xe_survivability_mode.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index 91a0680e449b..5fd40bc0dec0 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -168,12 +168,12 @@ static void populate_survivability_info(struct xe_device *xe)
 			set_survivability_info(mmio, info, POSTCODE_TRACE_OVERFLOW);
 	}
 
-	/* Traverse the linked list of aux info registers */
+	/* Read all aux info registers and store the non-zero ones */
 	if (reg_value & AUXINFO_SUPPORT) {
-		for (id = REG_FIELD_GET(AUXINFO_REG_OFFSET, reg_value);
-		     id >= AUX_INFO0 && id < MAX_SCRATCH_REG;
-		     id =  REG_FIELD_GET(AUXINFO_HISTORY_OFFSET, info[id]))
-			set_survivability_info(mmio, info, id);
+		for (id = AUX_INFO0; id < MAX_SCRATCH_REG; id++) {
+			if (xe_mmio_read32(mmio, PCODE_SCRATCH(id)))
+				set_survivability_info(mmio, info, id);
+		}
 	}
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2026-11-20 19:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 10:43 [PATCH v2] drm/xe/survivability: Fix infinite loop in aux info traversal Sk Anirban
2026-11-19 11:04 ` sashiko-bot
2026-11-19 12:36 ` ✓ CI.KUnit: success for drm/xe/survivability: Fix infinite loop in aux info traversal (rev2) Patchwork
2026-11-19 13:13 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-20 19:57 ` ✗ Xe.CI.FULL: failure " 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.