From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v12 4/4] drm/xe/ras: Use fault-inject to trigger punit error handler
Date: Fri, 24 Jul 2026 10:20:20 +0000 [thread overview]
Message-ID: <20260724102020.EFA071F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724100302.706685-10-mallesh.koujalagi@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Real hardware errors (PUNIT/CSC) detected during probe trigger a broken KOBJ_CHANGE uevent with an unresolvable DEVPATH, dropping the event silently and breaking cold-reset recovery. The patch works around this exclusively for injected errors, leaving the real bug unhandled.
--
--- Patch [4]: [PATCH v12 4/4] drm/xe/ras: Use fault-inject to trigger punit error handler ---
commit 7bec129b8ce98871b6643acdf5450a3fe7c276cd
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
drm/xe/ras: Use fault-inject to trigger punit error handler
Use fault-inject framework to trigger punit_error_handler()
for testing.
> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 92b4181026cbe..da06c16cf7ed9 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -391,6 +392,22 @@ enum xe_ras_recovery_action xe_ras_process_errors(struct xe_device *xe)
> size_t rlen;
> int ret;
>
> + /*
> + * Only allow the injected PUNIT error once the DRM device is registered.
> + * xe_ras_process_errors() also runs during probe (via xe_ras_init()), before
> + * drm_dev_register() calls device_add() on the DRM minor's kdev. At that
> + * point kdev->kobj.parent is not yet linked into the sysfs hierarchy, so
> + * kobject_get_path() returns "/card0" instead of the real sysfs path.
> + * drm_dev_wedged_event() would then emit a KOBJ_CHANGE uevent with a wrong
> + * DEVPATH that udev cannot resolve, silently dropping the event and leaving
> + * the cold-reset recovery broken.
> + */
> + if (xe->drm.registered && xe_fault_punit_error()) {
> + xe_err(xe, "[RAS]: PUNIT error injected\n");
> + punit_error_handler(xe);
> + return XE_RAS_RECOVERY_ACTION_DISCONNECT;
> + }
[Severity: High]
Does this same broken uevent issue also apply to real hardware errors detected
during probe?
The comment correctly identifies that calling punit_error_handler() before
the DRM device is registered emits a KOBJ_CHANGE uevent with a wrong DEVPATH.
However, if a real PUNIT error is detected during probe, the code bypasses
this guard and proceeds to handle_soc_internal_errors():
drivers/gpu/drm/xe/xe_ras.c:xe_ras_process_errors() {
...
case XE_RAS_COMP_SOC_INTERNAL:
action = handle_soc_internal_errors(xe, arr);
break;
...
}
Which unconditionally calls punit_error_handler() without the
xe->drm.registered check:
drivers/gpu/drm/xe/xe_ras.c:handle_soc_internal_errors() {
...
if (ieh_error->global_error_status & XE_RAS_SOC_IEH_PUNIT) {
xe_err(xe, "[RAS]: PUNIT %s detected: 0x%x\n",
sev_to_str(counter->common.severity),
ieh_error->global_error_status);
punit_error_handler(xe);
return XE_RAS_RECOVERY_ACTION_DISCONNECT;
}
...
}
Should the underlying uevent emission in punit_error_handler() be delayed
or guarded until after registration, rather than only working around it for
injected errors?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724100302.706685-6-mallesh.koujalagi@intel.com?part=4
next prev parent reply other threads:[~2026-07-24 10:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 10:03 [PATCH v12 0/4] Introduce cold reset recovery method Mallesh Koujalagi
2026-07-24 10:03 ` [PATCH v12 1/4] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET " Mallesh Koujalagi
2026-07-24 10:16 ` sashiko-bot
2026-07-24 10:03 ` [PATCH v12 2/4] drm/doc: Document " Mallesh Koujalagi
2026-07-24 10:13 ` sashiko-bot
2026-07-24 10:03 ` [PATCH v12 3/4] drm/xe: Handle PUNIT errors by requesting cold-reset recovery Mallesh Koujalagi
2026-07-24 10:29 ` sashiko-bot
2026-07-24 10:03 ` [PATCH v12 4/4] drm/xe/ras: Use fault-inject to trigger punit error handler Mallesh Koujalagi
2026-07-24 10:20 ` sashiko-bot [this message]
2026-07-28 8:32 ` Tauro, Riana
2026-07-28 19:25 ` Rodrigo Vivi
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=20260724102020.EFA071F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mallesh.koujalagi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox