From: "Mallesh, Koujalagi" <mallesh.koujalagi@intel.com>
To: "Tauro, Riana" <riana.tauro@intel.com>,
<intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <rodrigo.vivi@intel.com>
Cc: <andrealmeid@igalia.com>, <christian.koenig@amd.com>,
<airlied@gmail.com>, <simona.vetter@ffwll.ch>,
<mripard@kernel.org>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>, <karthik.poosa@intel.com>,
<sk.anirban@intel.com>, <raag.jadav@intel.com>
Subject: Re: [PATCH v2 4/5] drm/xe: Add handler for power management unit errors which require cold-reset
Date: Mon, 30 Mar 2026 19:20:03 +0530 [thread overview]
Message-ID: <dd97f18e-2841-4bac-8e5c-7068d6555943@intel.com> (raw)
In-Reply-To: <e2847c9e-5550-474a-b0b5-19844787c200@intel.com>
Hi Riana,
On 30-03-2026 10:24 am, Tauro, Riana wrote:
>
> On 3/18/2026 12:10 PM, Mallesh Koujalagi wrote:
>> This handler is designed to be called when power management unit
>> errors are
>> detected that affect device-level state persisting across warm resets.
> Commit message should be clear.
>> The
>> cold reset recovery method signals to userspace that only a complete
>> device
>> power cycle can restore normal operation.
>>
>> v2:
>> - Add use case: Handling errors from power management unit,
>> which requires a complete power cycle (cold reset)
>> to recover. (Christian)
> This is not an addition to the patch. Only add this in cover letter.
>>
>> Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_hw_error.c | 27 +++++++++++++++++++++++++++
>> drivers/gpu/drm/xe/xe_hw_error.h | 1 +
>> drivers/gpu/drm/xe/xe_ras.c | 3 ++-
>> 3 files changed, 30 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_hw_error.c
>> b/drivers/gpu/drm/xe/xe_hw_error.c
>> index 2a31b430570e..ca965a2b092c 100644
>> --- a/drivers/gpu/drm/xe/xe_hw_error.c
>> +++ b/drivers/gpu/drm/xe/xe_hw_error.c
>> @@ -5,6 +5,7 @@
>> #include <linux/bitmap.h>
>> #include <linux/fault-inject.h>
>> +#include <drm/drm_drv.h>
>> #include "regs/xe_gsc_regs.h"
>> #include "regs/xe_hw_error_regs.h"
>> @@ -542,6 +543,32 @@ static void process_hw_errors(struct xe_device *xe)
>> }
>> }
>> +/**
>> + * xe_punit_error_handler - Handler for power management unit errors
>> + * @xe: device instance
>> + *
>> + * Handles power management unit errors that affect the device and
>> cannot
>> + * be recovered through driver reload, PCIe reset, etc.
>> + *
>> + * Marks the device as wedged with DRM_WEDGE_RECOVERY_COLD_RESET method
>> + * and notifies userspace that a complete device power cycle is
>> required.
>> + */
>> +void xe_punit_error_handler(struct xe_device *xe)
>
> You can move this to xe_ras
Sure, will move to xe_ras.c in v3.
>
>> +{
>> + drm_err(&xe->drm, "CRITICAL: PMU error detected\n");
>
> PMU? also means Performance monitoring unit. Please use Punit instead
> Keep this consistent in both commit message, kernel-doc and code
>
Good catch, will replace "PMU" reference with "Punit" across commit
message, kernel-doc etc.
>> + drm_err(&xe->drm, "Recovery: Device cold reset required\n");
> power-cycle/cold-reset. Use consistent wording
Sure, will use "cold reset " consistently in v3.
Thanks,
-/Mallesh
> Thanks
> Riana
>
>> +
>> + /* Set cold reset recovery method */
>> + xe_device_set_wedged_method(xe, DRM_WEDGE_RECOVERY_COLD_RESET);
>> +
>> + if (xe_device_wedged(xe)) {
>> + drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL);
>> + } else {
>> + /* Declare device wedged - will trigger uevent with cold
>> reset method */
>> + xe_device_declare_wedged(xe);
>> + }
>> +}
>> +
>> /**
>> * xe_hw_error_init - Initialize hw errors
>> * @xe: xe device instance
>> diff --git a/drivers/gpu/drm/xe/xe_hw_error.h
>> b/drivers/gpu/drm/xe/xe_hw_error.h
>> index d86e28c5180c..f588320eb94d 100644
>> --- a/drivers/gpu/drm/xe/xe_hw_error.h
>> +++ b/drivers/gpu/drm/xe/xe_hw_error.h
>> @@ -11,5 +11,6 @@ struct xe_tile;
>> struct xe_device;
>> void xe_hw_error_irq_handler(struct xe_tile *tile, const u32
>> master_ctl);
>> +void xe_punit_error_handler(struct xe_device *xe);
>> void xe_hw_error_init(struct xe_device *xe);
>> #endif
>> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
>> index 777321021391..93257d0eaaa0 100644
>> --- a/drivers/gpu/drm/xe/xe_ras.c
>> +++ b/drivers/gpu/drm/xe/xe_ras.c
>> @@ -10,6 +10,7 @@
>> #include "xe_survivability_mode.h"
>> #include "xe_sysctrl_mailbox.h"
>> #include "xe_sysctrl_mailbox_types.h"
>> +#include "xe_hw_error.h"
>> #define COMPUTE_ERROR_SEVERITY_MASK GENMASK(26, 25)
>> #define GLOBAL_UNCORR_ERROR 2
>> @@ -148,7 +149,7 @@ static enum xe_ras_recovery_action
>> handle_soc_internal_errors(struct xe_device *
>> xe_err(xe, "[RAS]: PUNIT %s error detected: 0x%x\n",
>> severity_to_str(xe, common_info.severity),
>> ieh_error->error_sources_ieh0.punit);
>> - /** TODO: Add PUNIT error handling */
>> + xe_punit_error_handler(xe);
>> action = XE_RAS_RECOVERY_ACTION_DISCONNECT;
>> }
>> }
next prev parent reply other threads:[~2026-03-30 13:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 6:40 [PATCH v2 0/5] Introduce cold reset recovery method Mallesh Koujalagi
2026-03-18 6:40 ` [PATCH v2 1/5] Introduce Xe Uncorrectable Error Handling Mallesh Koujalagi
2026-03-18 19:35 ` kernel test robot
2026-03-19 14:42 ` kernel test robot
2026-03-19 20:02 ` kernel test robot
2026-03-18 6:40 ` [PATCH v2 2/5] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET for power management unit error Mallesh Koujalagi
2026-03-30 5:26 ` Tauro, Riana
2026-03-18 6:40 ` [PATCH v2 3/5] drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET recovery method Mallesh Koujalagi
2026-03-30 5:00 ` Tauro, Riana
2026-03-30 14:02 ` Mallesh, Koujalagi
2026-04-02 8:16 ` Raag Jadav
2026-04-06 12:26 ` Mallesh, Koujalagi
2026-03-18 6:40 ` [PATCH v2 4/5] drm/xe: Add handler for power management unit errors which require cold-reset Mallesh Koujalagi
2026-03-30 4:54 ` Tauro, Riana
2026-03-30 13:50 ` Mallesh, Koujalagi [this message]
2026-04-02 8:19 ` Raag Jadav
2026-03-18 6:40 ` [PATCH v2 5/5] drm/xe/debugfs: Add interface to trigger power management unit error handler Mallesh Koujalagi
2026-03-30 4:55 ` Tauro, Riana
2026-03-30 13:40 ` Mallesh, Koujalagi
2026-04-02 8:31 ` Raag Jadav
2026-04-06 12:49 ` Mallesh, Koujalagi
2026-03-18 6:49 ` ✗ CI.checkpatch: warning for Introduce cold reset recovery method Patchwork
2026-03-18 6:50 ` ✓ CI.KUnit: success " Patchwork
2026-03-18 7:33 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-19 20:20 ` ✓ Xe.CI.FULL: " Patchwork
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=dd97f18e-2841-4bac-8e5c-7068d6555943@intel.com \
--to=mallesh.koujalagi@intel.com \
--cc=airlied@gmail.com \
--cc=andrealmeid@igalia.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--cc=mripard@kernel.org \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona.vetter@ffwll.ch \
--cc=sk.anirban@intel.com \
/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