]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/reg_sr: Add debugfs to verify status of reg_sr programming
authorMatt Roper <matthew.d.roper@intel.com>
Wed, 18 Feb 2026 22:09:13 +0000 (14:09 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 19 Feb 2026 15:31:05 +0000 (07:31 -0800)
commitd389489225b85aac3ad90ed8b5661679f27a2da4
tree356f2ef64240e121d7f508ecab0f1288bf6470d7
parenta41ee215b59d78f8cd0a4b05e373335944e0ecb0
drm/xe/reg_sr: Add debugfs to verify status of reg_sr programming

When applying save-restore register programming for workarounds, tuning
settings, and general device configuration we assume the programming was
successful.  However there are a number of cases where the desired
reg_sr programming can become lost:

 - workarounds implemented on the wrong RTP table might not get
   saved/restored at the right time leading to, for example, failure to
   re-apply the programming after engine resets
 - some hardware registers become "locked" and can no longer be updated
   after firmware or the driver finishes initializing them
 - sometimes the hardware teams just made a mistake when documenting the
   register and/or bits that needed to be programmed

Add a debugfs entry that will read back the registers referenced on a
GT's save-restore lists and print any cases where the desired
programming is no longer in effect.  Such cases might indicate the
presence of a driver/firmware bug, might indicate that the documentation
we were following has a mistake, or might be benign (occasionally
registers have broken read-back capability preventing verification, but
previous writes were still successful and effective).

For now we only verify the GT and engine reg_sr lists.  Verifying the
LRC list will require checking the expected programming against the
default_lrc contents, not the live registers (which may not reflect the
reg_sr programming if no context is actively running).

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20260218-sr_verify-v4-2-35d6deeb3421@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_gt_debugfs.c
drivers/gpu/drm/xe/xe_reg_sr.c
drivers/gpu/drm/xe/xe_reg_sr.h