[PATCH v2 0/5] Introduce cold reset recovery method

Mallesh Koujalagi
2026-03-18T06:42:58Z

This series builds on top of Introduce Xe Uncorrectable Error Handling[1]
and adds support for handling power management unit (PMU) errors
that require a complete device power cycle to recover.

Certain PMU error conditions leave the device in a persistent hardware
error state that cannot be cleared through existing recovery mechanisms
such as driver reload or PCIe reset. In these cases, functionality can
only be restored by performing a cold reset (complete power cycle).

To support this, the series introduces a new DRM wedging recovery
method, DRM_WEDGE_RECOVERY_COLD_RESET (BIT(4)). When a device is wedged
with this method, the DRM core notifies userspace via a uevent that a cold
reset is required. This allows userspace to take appropriate action to
power-cycle the device.

Example uevent received:
SUBSYSTEM=drm
WEDGED=cold-reset
DEVPATH=/devices/.../drm/card0

The cold reset recovery path can be exercised through the debugfs
interface:

echo 1 > /sys/kernel/debug/dri/N/trigger_punit_error

This triggers the PMU error handler, wedges the device using the cold
reset recovery method, and emits the corresponding uevent to userspace.

Detailed description in commit message.

[1] https://patchwork.freedesktop.org/series/160482/
This patch series introduces a call to xe_punit_error_handler() from
within handle_soc_internal_errors() when PMU errors detected.

v2:
- Add use case: Handling errors from power management unit,
which requires a complete power cycle (cold reset)
to recover. (Christian)
- Add several instead of number to avoid update. (Jani)

Cc: André Almeida <andrealmeid@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona.vetter@ffwll.ch>
Cc: Maxime Ripard <mripard@kernel.org>

Mallesh Koujalagi (4):
drm: Add DRM_WEDGE_RECOVERY_COLD_RESET for power management unit error
drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET recovery method
drm/xe: Add handler for power management unit errors which require
cold-reset
drm/xe/debugfs: Add interface to trigger power management unit error
handler

Riana Tauro (1):
Introduce Xe Uncorrectable Error Handling

Documentation/gpu/drm-uapi.rst | 73 +++-
drivers/gpu/drm/drm_drv.c | 2 +
drivers/gpu/drm/xe/Makefile | 4 +
drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h | 36 ++
drivers/gpu/drm/xe/xe_debugfs.c | 38 ++
drivers/gpu/drm/xe/xe_device.c | 15 +
drivers/gpu/drm/xe/xe_device.h | 15 +
drivers/gpu/drm/xe/xe_device_types.h | 12 +
drivers/gpu/drm/xe/xe_gt.c | 11 +-
drivers/gpu/drm/xe/xe_guc_submit.c | 9 +-
drivers/gpu/drm/xe/xe_hw_error.c | 27 ++
drivers/gpu/drm/xe/xe_hw_error.h | 1 +
drivers/gpu/drm/xe/xe_pci.c | 5 +
drivers/gpu/drm/xe/xe_pci_error.c | 111 +++++
drivers/gpu/drm/xe/xe_pci_types.h | 1 +
drivers/gpu/drm/xe/xe_ras.c | 332 +++++++++++++++
drivers/gpu/drm/xe/xe_ras.h | 16 +
drivers/gpu/drm/xe/xe_ras_types.h | 282 +++++++++++++
drivers/gpu/drm/xe/xe_survivability_mode.c | 12 +-
drivers/gpu/drm/xe/xe_sysctrl.c | 80 ++++
drivers/gpu/drm/xe/xe_sysctrl.h | 13 +
drivers/gpu/drm/xe/xe_sysctrl_mailbox.c | 390 ++++++++++++++++++
drivers/gpu/drm/xe/xe_sysctrl_mailbox.h | 35 ++
drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h | 55 +++
drivers/gpu/drm/xe/xe_sysctrl_types.h | 33 ++
include/drm/drm_device.h | 1 +
26 files changed, 1600 insertions(+), 9 deletions(-)
create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
create mode 100644 drivers/gpu/drm/xe/xe_pci_error.c
create mode 100644 drivers/gpu/drm/xe/xe_ras.c
create mode 100644 drivers/gpu/drm/xe/xe_ras.h
create mode 100644 drivers/gpu/drm/xe/xe_ras_types.h
create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h
create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h

--
2.34.1