From: sashiko-bot@kernel.org
To: "Raag Jadav" <raag.jadav@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v13 9/9] drm/xe/ras: Move xe_ras_process_errors() to xe_ras
Date: Tue, 20 Oct 2026 09:27:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-178736@kernel.org> (raw)
In-Reply-To: <20261020023641.200658-10-raag.jadav@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/xe/ras: early wedging in xe_ras_init() breaks GT init and DRM registration
--
commit 9ceb08e30ef3aa269ebad9c4f296fb67c41a76af
Author: Raag Jadav <raag.jadav@intel.com>
drm/xe/ras: Move xe_ras_process_errors() to xe_ras
This commit moves the boot-time call to xe_ras_process_errors() from the end
of xe_device_probe() back into xe_ras_init(), reverting commit 20bc4883c7c0
("drm/xe/ras: Fix boot-time ras error processing") now that xe_wedge_fini()
is registered during xe_device_probe_early().
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 0072bb4cc5dfe..db3cbc186a514 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -1212,6 +1212,13 @@ int xe_ras_init(struct xe_device *xe)
> get_offline_list(xe);
> get_offline_queue(xe);
>
> + /*
> + * During probe, process and log any errors detected by firmware while the driver was not
> + * loaded. Critical errors such as Punit and CSC are reported through Pcode init failure,
> + * causing the driver to enter survivability mode.
> + */
> + xe_ras_process_errors(xe);
[Severity: High]
Can moving xe_ras_process_errors() into xe_ras_init() break probe when a
boot-time RAS error or cold-reset wedge fault injection declares the device
wedged?
While registering xe_wedge_fini() in xe_device_probe_early() resolves the PM
reference cleanup issue, xe_ras_init() still runs in xe_device_probe() before
both xe_gt_init() and drm_dev_register():
drivers/gpu/drm/xe/xe_device.c:xe_device_probe() {
err = xe_ras_init(xe);
if (err)
return err;
...
for_each_gt(gt, xe, id) {
err = xe_gt_init(gt);
if (err)
return err;
}
...
err = drm_dev_register(&xe->drm, 0);
}
Inside xe_ras_process_errors(), xe_wedge_declare() can be called via three
paths:
- handle_soc_internal_errors() -> xe_survivability_mode_runtime_enable() on
a CSC firmware error (csc_error->hec_fw_error)
- handle_soc_internal_errors() -> punit_error_handler() on an IEH Punit
error (XE_RAS_SOC_IEH_PUNIT)
- xe_fault_wedge_cold_reset() -> punit_error_handler()
When xe_wedge_declare() runs during xe_ras_init(), it sets xe->wedged.flag = 1
and schedules xe->wedged.work (wedge_work):
drivers/gpu/drm/xe/xe_wedge.c:xe_wedge_declare() {
if (atomic_xchg(&xe->wedged.flag, 1))
return;
...
for_each_initialized_gt(gt, xe, id)
xe_gt_wedge_declare(gt);
...
schedule_work(&xe->wedged.work);
}
Because xe_ras_init() returns 0, xe_device_probe() continues into
xe_gt_init() -> gt_init_with_all_forcewake() -> xe_uc_load_hw(). With
xe_wedged(xe) already set, guc_exec_queue_run_job() drops submissions (causing
xe_gt_record_default_lrcs() / emit_wa_job() to time out with -ETIME), and
__guc_ct_send_locked() fails immediately:
drivers/gpu/drm/xe/xe_guc_ct.c:__guc_ct_send_locked() {
if (xe_wedged(ct_to_xe(ct))) {
ret = -ENOTRECOVERABLE;
goto out;
}
}
That causes xe_guc_post_load_init(), xe_guc_pc_start(), and xe_guc_rc_enable()
to fail, aborting xe_gt_init() and xe_device_probe() and unwinding devres
actions (including xe_survivability_mode_fini(), which removes the runtime
survivability sysfs attributes just created by
xe_survivability_mode_runtime_enable()).
Concurrently, wedge_work() invokes drm_dev_wedged_event(), which sends a
KOBJ_CHANGE uevent on dev->primary->kdev->kobj before drm_dev_register() ->
drm_minor_register() -> device_add() has registered the primary minor device:
drivers/gpu/drm/xe/xe_wedge.c:wedge_work()
-> drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL)
-> kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp)
In addition,xe_ras_init() returns early when !xe->info.has_sysctrl before
reaching xe_ras_process_errors(), whereas xe_ras_process_errors() checks
xe_fault_wedge_cold_reset() before checking !xe->info.has_sysctrl:
drivers/gpu/drm/xe/xe_ras.c:xe_ras_process_errors() {
if (xe_fault_wedge_cold_reset()) {
xe_err(xe, "[RAS]: cold-reset wedge injected\n");
punit_error_handler(xe);
return XE_RAS_RECOVERY_ACTION_DISCONNECT;
}
if (!xe->info.has_sysctrl)
return XE_RAS_RECOVERY_ACTION_RESET;
}
Does moving this call into xe_ras_init() also bypass cold-reset wedge fault
injection on platforms without sysctrl?
> +
> ret = devm_device_add_group(xe->drm.dev, &gpu_health_group);
> if (ret)
> xe_err(xe, "Failed to create GPU health sysfs, err=%d\n", ret);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261020023641.200658-1-raag.jadav@intel.com?part=9
prev parent reply other threads:[~2026-10-20 9:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 2:36 [PATCH v13 0/9] Introduce xe_wedge Raag Jadav
2026-10-20 2:36 ` [PATCH v13 1/9] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
2026-10-20 8:30 ` sashiko-bot
2026-10-20 2:36 ` [PATCH v13 2/9] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
2026-10-20 2:36 ` [PATCH v13 3/9] drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM Raag Jadav
2026-10-20 2:36 ` [PATCH v13 4/9] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Raag Jadav
2026-10-20 2:36 ` [PATCH v13 5/9] drm/xe: Make xe_device_declare_wedged() IRQ safe Raag Jadav
2026-10-20 2:36 ` [PATCH v13 6/9] drm/xe/pci_error: Flush GT wedge worker before bus reset Raag Jadav
2026-10-20 2:36 ` [PATCH v13 7/9] drm/xe/amc: Guard xe_amc_work() with runtime PM Raag Jadav
2026-10-20 2:36 ` [PATCH v13 8/9] drm/xe: Introduce xe_wedge Raag Jadav
2026-10-20 2:36 ` [PATCH v13 9/9] drm/xe/ras: Move xe_ras_process_errors() to xe_ras Raag Jadav
2026-10-20 9:27 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-178736@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=raag.jadav@intel.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.