From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Mallesh Koujalagi <mallesh.koujalagi@intel.com>,
<intel-xe@lists.freedesktop.org>, <rodrigo.vivi@intel.com>,
<matthew.brost@intel.com>
Cc: <anshuman.gupta@intel.com>, <vinay.belgaumkar@intel.com>,
<riana.tauro@intel.com>, <karthik.poosa@intel.com>,
<sk.anirban@intel.com>, <raag.jadav@intel.com>,
<aravind.iddamsetty@linux.intel.com>,
<jani.nikula@linux.intel.com>
Subject: Re: [PATCH v5 2/6] drm/xe/cper: Prepare CPER headers for software errors
Date: Sat, 21 Nov 2026 12:18:44 +0530 [thread overview]
Message-ID: <42fd85c8-7e94-4def-be53-e79a281edc78@intel.com> (raw)
In-Reply-To: <20261119060019.2031897-10-mallesh.koujalagi@intel.com>
On 19-11-2026 11:30, Mallesh Koujalagi wrote:
> Add software error classification support and reuse the
> common CPER header initialization path.
>
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
> ---
> v2:
> - Move union inside xe_cper_intel_hdr structure. (Badal)
>
> v3:
> - Introduce structure where it's used. (Badal)
> - Move error-class union inside cper_init_intel_hdr. (Badal)
>
> v4:
> - Update commit message. (Badal)
> - Use ktime_get_real_ns.
> - Add BUILD_BUG_ON. (Raag)
>
> v5:
> - Call timestamp near to use. (Badal)
> ---
> drivers/gpu/drm/xe/xe_cper.c | 26 ++++++++++++++++++++----
> drivers/gpu/drm/xe/xe_cper_types.h | 32 ++++++++++++++++++++++++++++--
> 2 files changed, 52 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_cper.c b/drivers/gpu/drm/xe/xe_cper.c
> index efc49ecb86c2..4cb83896c6b5 100644
> --- a/drivers/gpu/drm/xe/xe_cper.c
> +++ b/drivers/gpu/drm/xe/xe_cper.c
> @@ -14,6 +14,8 @@
> #include <linux/time.h>
> #include <linux/timekeeping.h>
>
> +#include "abi/xe_log_abi.h"
> +
> #include "xe_cper.h"
> #include "xe_cper_types.h"
> #include "xe_device.h"
> @@ -92,11 +94,14 @@ static u64 cper_timestamp_now(void)
> return ts;
> }
>
> -static void cper_init_intel_hdr(struct xe_device *xe, const struct xe_ras_error_class *counter,
> +static void cper_init_intel_hdr(struct xe_device *xe, const union xe_cper_error_class *error_class,
> u64 first_timestamp, u32 sig_id, u32 error_count,
> struct xe_cper_intel_hdr *ihdr)
> {
> - ihdr->counter = *counter;
> + BUILD_BUG_ON(sizeof(struct xe_ras_error_class) !=
> + sizeof(struct xe_cper_driver_error_class));
> +
> + ihdr->error_class = *error_class;
> ihdr->validation_bits |= XE_CPER_VALID_LOCATION;
> ihdr->sig_id = U32_MAX;
>
> @@ -219,12 +224,12 @@ void xe_cper_emit_counter(struct xe_device *xe, int cper_sev, enum xe_sigid sigi
> const struct xe_ras_error_class *counter,
> const struct xe_ras_get_counter_response *response)
> {
> + union xe_cper_error_class error_class = { .counter = *counter };
> struct xe_cper_intel_hdr ihdr = {};
>
> xe_assert(xe, is_hw_sigid(sigid));
>
> - cper_init_intel_hdr(xe, counter, response->timestamp,
> - sigid, response->value, &ihdr);
> + cper_init_intel_hdr(xe, &error_class, response->timestamp, sigid, response->value, &ihdr);
> cper_record_emit(xe, cper_sev, &INTEL_CPER_NOTIFY_GPU_ERROR, &ihdr, NULL, 0);
> }
>
> @@ -249,6 +254,19 @@ static void cper_emit_sw_err(struct xe_device *xe, int cper_sev, enum xe_sigid s
> u32 component, u32 location, const void *data,
> struct va_format *vaf)
> {
> + union xe_cper_error_class error_class = {};
> + struct xe_cper_intel_hdr ihdr = {};
> + struct xe_cper_driver_error_class *driver = &error_class.driver;
> + u64 timestamp;
> +
> + driver->error_type = cper_sev;
> + driver->error_component = component;
> + driver->tile = location;
> + if (IS_ERR(data))
> + driver->cause = -PTR_ERR(data);
> +
> + timestamp = ktime_get_real_ns();
> + cper_init_intel_hdr(xe, &error_class, timestamp, sigid, 1, &ihdr);
> }
>
> /**
> diff --git a/drivers/gpu/drm/xe/xe_cper_types.h b/drivers/gpu/drm/xe/xe_cper_types.h
> index 68e30df0440e..c9ea8b1694a9 100644
> --- a/drivers/gpu/drm/xe/xe_cper_types.h
> +++ b/drivers/gpu/drm/xe/xe_cper_types.h
> @@ -45,6 +45,29 @@
> GUID_INIT(0xea9d8f84, 0x4258, 0x5227, \
> 0x80, 0x28, 0xb9, 0xb1, 0x3e, 0x6d, 0x58, 0xb0)
>
> +/**
> + * struct xe_cper_driver_error_class - Intel GPU CPER driver-detected error classification
> + */
> +struct xe_cper_driver_error_class {
> + /** @error_type: CPER severity: CPER_SEV_* */
> + u8 error_type;
> + /** @reserved0: Reserved, must be zero */
> + u8 reserved0;
> + /** @error_component: Driver component id: CLASS[7:0].TYPE[15:8] */
> + u16 error_component;
> + /** @tile: Driver location id: TYPE[7:0].ID[15:8] ('tile' and 'GT' field region) */
> + u16 tile;
> + /** @reserved1: Reserved, must be zero */
> + u16 reserved1;
> + /** @cause: errno of the failing operation, or 0 if none */
> + u32 cause;
> +};
> +
> +/* Same size as the counter-sourced error_class */
> +#define XE_CPER_ERROR_CLASS_SIZE 12
> +
> +static_assert(sizeof(struct xe_cper_driver_error_class) == XE_CPER_ERROR_CLASS_SIZE);
> +
> /**
> * struct xe_cper_intel_hdr - Intel-specific CPER header
> *
> @@ -52,8 +75,13 @@
> * All multi-byte fields are little-endian.
> */
> struct xe_cper_intel_hdr {
> - /** @counter: Error class (severity, component, location, cause) */
> - struct xe_ras_error_class counter;
> + /** @error_class: Error classification */
> + union xe_cper_error_class {
> + /** @error_class.counter: Error class (severity, component, location, cause) */
> + struct xe_ras_error_class counter;
> + /** @error_class.driver: Driver-detected error classification */
> + struct xe_cper_driver_error_class driver;
> + } error_class;
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
> /** @first_timestamp: First occurrence of this error class, in ticks */
> u64 first_timestamp;
> /** @sig_id: Aggregated error class SIG ID; set to U32_MAX if unknown */
next prev parent reply other threads:[~2026-11-21 6:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 6:00 [PATCH v5 0/6] drm/xe/cper: Software (driver-detected) CPER error reporting Mallesh Koujalagi
2026-11-19 6:00 ` [PATCH v5 1/6] drm/xe/cper: Add software CPER emission entry point Mallesh Koujalagi
2026-11-19 6:00 ` [PATCH v5 2/6] drm/xe/cper: Prepare CPER headers for software errors Mallesh Koujalagi
2026-11-21 6:48 ` Nilawar, Badal [this message]
2026-11-19 6:00 ` [PATCH v5 3/6] drm/xe/cper: Emit software CPER records Mallesh Koujalagi
2026-11-21 6:55 ` Nilawar, Badal
2026-11-19 6:00 ` [PATCH v5 4/6] drm/xe/cper: Make software CPER emission atomic-safe Mallesh Koujalagi
2026-11-19 6:00 ` [PATCH v5 5/6] drm/xe/log: Add software CPER information to KUnit output Mallesh Koujalagi
2026-11-19 6:00 ` [PATCH v5 6/6] drm/xe/log: Test software CPER emission parameters Mallesh Koujalagi
2026-11-19 8:08 ` ✓ CI.KUnit: success for drm/xe/cper: Software (driver-detected) CPER error reporting (rev5) Patchwork
2026-11-19 9:00 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-20 13:14 ` ✓ 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=42fd85c8-7e94-4def-be53-e79a281edc78@intel.com \
--to=badal.nilawar@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=aravind.iddamsetty@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=karthik.poosa@intel.com \
--cc=mallesh.koujalagi@intel.com \
--cc=matthew.brost@intel.com \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=sk.anirban@intel.com \
--cc=vinay.belgaumkar@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 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.