[PATCH v4 12/13] drm/xe/xe_ras: Query errors from system controller on probe

Riana Tauro
2026-04-17T08:26:23Z

Reorder soc remapper and system controller initialization to
early probe to allow querying errors on module load.

Cc: Anoop Vijay <anoop.c.vijay@intel.com>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
---
drivers/gpu/drm/xe/xe_device.c | 20 ++++++++++----------
drivers/gpu/drm/xe/xe_ras.c | 7 +++++++
2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index c1c54836ac73..035c8151605a 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -970,6 +970,16 @@ int xe_device_probe(struct xe_device *xe)
if (err)
return err;

+ err = xe_soc_remapper_init(xe);
+ if (err)
+ return err;
+
+ err = xe_sysctrl_init(xe);
+ if (err)
+ return err;
+
+ xe_ras_init(xe);
+
/*
* Now that GT is initialized (TTM in particular),
* we can try to init display, and inherit the initial fb.
@@ -1010,10 +1020,6 @@ int xe_device_probe(struct xe_device *xe)

xe_nvm_init(xe);

- err = xe_soc_remapper_init(xe);
- if (err)
- return err;
-
err = xe_heci_gsc_init(xe);
if (err)
return err;
@@ -1052,10 +1058,6 @@ int xe_device_probe(struct xe_device *xe)
if (err)
goto err_unregister_display;

- err = xe_sysctrl_init(xe);
- if (err)
- goto err_unregister_display;
-
err = xe_device_sysfs_init(xe);
if (err)
goto err_unregister_display;
@@ -1075,8 +1077,6 @@ int xe_device_probe(struct xe_device *xe)

xe_vsec_init(xe);

- xe_ras_init(xe);
-
err = xe_sriov_init_late(xe);
if (err)
goto err_unregister_display;
diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index 42ec27c05e9a..7598eeb796f0 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -479,4 +479,11 @@ void xe_ras_init(struct xe_device *xe)
/* Get any pages that need to be offlined from firmware and reserve them */
get_offlined_list(xe);
get_queued_pages(xe);
+
+ /*
+ * On init, process and log any errors detected by firmware before driver init.
+ * Critical errors are handled in xe_pcode_probe_early(), which enters survivability mode
+ * if required.
+ */
+ xe_ras_process_errors(xe);
}
--
2.47.1