Re: [PATCH v11 3/3] drm/xe: Handle PUNIT errors by requesting cold-reset recovery
"Mallesh, Koujalagi" <[email protected]>
| Newsgroups | dev.linux.lists.sashiko-reviews,org.freedesktop.lists.dri-devel |
|---|---|
| Message-ID | <[email protected]> |
On 21-07-2026 11:07 pm, Rodrigo Vivi wrote: > On Mon, Jul 20, 2026 at 10:48:15AM +0000, [email protected] wrote: >> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: >> - [High] Calling `xe_device_declare_wedged()` during early driver probe fails to notify userspace because the DRM device is not yet registered in sysfs. >> -- >> >> --- Patch [3]: [PATCH v11 3/3] drm/xe: Handle PUNIT errors by requesting cold-reset recovery --- >> commit e4801339581daca0be0db10f90d94f25e72cfa52 >> Author: Mallesh Koujalagi <[email protected]> >> >> drm/xe: Handle PUNIT errors by requesting cold-reset recovery >> >> When PUNIT (power management unit) errors are detected that persist across >> warm resets, mark the device as wedged with DRM_WEDGE_RECOVERY_COLD_RESET >> and notify userspace that a complete device power cycle is required to >> restore normal operation. >> >>> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c >>> index a31e06b8aa67a..92b4181026cbe 100644 >>> --- a/drivers/gpu/drm/xe/xe_ras.c >>> +++ b/drivers/gpu/drm/xe/xe_ras.c >> [ ... ] >>> @@ -236,6 +236,12 @@ static u8 handle_core_compute_errors(struct xe_ras_error_array *arr) >>> return XE_RAS_RECOVERY_ACTION_RECOVERED; >>> } >>> >>> +static void punit_error_handler(struct xe_device *xe) >>> +{ >>> + xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_COLD_RESET); >>> + xe_device_declare_wedged(xe); >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> [Severity: High] >> Does calling xe_device_declare_wedged() here fail to notify userspace when >> triggered during early driver probe? >> >> If a PUNIT error is present at driver load, the call chain is: >> >> xe_device_probe() >> xe_ras_init() >> xe_ras_process_errors() >> handle_soc_internal_errors() >> punit_error_handler() >> xe_device_declare_wedged() >> drm_dev_wedged_event() >> >> Since drm_dev_register() has not yet been called at this stage of the probe >> path, the sysfs directory for the DRM device does not exist, and the KOBJ_ADD >> event has not been emitted. >> >> Consequently, userspace (e.g., udev) will likely drop or ignore the KOBJ_CHANGE >> uevent emitted by drm_dev_wedged_event(). >> >> Will this cause the device to finish probe successfully but leave userspace >> unaware of the wedged state, breaking the automated cold reset recovery >> mechanism? > Mallesh, could you please add a fault-inject test to this flow here and > ensure that we are indeed getting the notification we are willing to get? > > It looks that right now we are really never getting the uevent that we > are willing to get. > > Thanks, > Rodrigo. In boot-time punit error, the device goes into boot survivability mode and never reaches the punit_error_handler() → xe_device_declare_wedged() path before drm_dev_register(). Because of this, the dropped uevent scenario does not actually occur in practice. Thanks, -/Mallesh >>> +} >>> + >>> static u8 handle_soc_internal_errors(struct xe_device *xe, struct xe_ras_error_array *arr) >>> { >>> struct xe_ras_soc_error *info = (void *)arr->details; >> -- >> Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3