All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Badal Nilawar <badal.nilawar@intel.com>
Cc: intel-xe@lists.freedesktop.org, anshuman.gupta@intel.com,
	rodrigo.vivi@intel.com, daniele.ceraolospurio@intel.com,
	riana.tauro@intel.com, mallesh.koujalagi@intel.com,
	aravind.iddamsetty@intel.com, himal.prasad.ghimiray@intel.com,
	arvind.yadav@intel.com, syed.abdul.muqthyar.ahmed@intel.com,
	nitin.r.gote@intel.com, matthew.d.roper@intel.com
Subject: Re: [PATCH v8 3/3] drm/xe/cper: Prepare Intel CPER info records
Date: Fri, 20 Nov 2026 12:19:02 +0100	[thread overview]
Message-ID: <awAspuvr9q8Eav8r@black.igk.intel.com> (raw)
In-Reply-To: <20261120043303.107183-8-badal.nilawar@intel.com>

On Fri, Nov 20, 2026 at 10:03:06AM +0530, Badal Nilawar wrote:
> The RAS info queue contains error logs for detail counters, or dynamic
> counter headers followed by error logs for aggregate counters.
> 
> Build CPER info records from the queue data, converting each error log
> into an CPER event. For aggregate counters, group logs by their dynamic
> counter header and build one info record per header.
> 
> Emit a CPER record for each generated info record.

A few nits below but we're good to go.

> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
> v6:
>   - Reintroduce event_ prefixes
>   - %s/einfo/info/
>   - Split cper_prepare_einfo() into queue-fetch and info-array
>     construction helpers (Raag)
>   - Rename the dynamic counter header's count field to error_count (Raag)
> v7:
>   - Retain einfo for existing payload variables and length parameter
>   - Rework cper_prepare_info() to return the number of entrie and info
>     array as an output argument. (Raag)
> v8:
>   - Swap fill_info() and build_info() names (Raag)
>   - Rename the header type to xe_ras_dynamic_counter_hdr (Raag)
>   - Return the byte count from cper_get_info_queue_buffer() and provide
>     the buffer through an output argument (Raag)
>   - Move drain assertions into cper_get_info_queue_buffer() and drop the
>     emit-function context requirement (Raag)
> ---
>  drivers/gpu/drm/xe/xe_cper.c       | 257 ++++++++++++++++++++++++++++-
>  drivers/gpu/drm/xe/xe_cper_types.h |  59 ++++++-
>  drivers/gpu/drm/xe/xe_ras_types.h  |  27 +++
>  3 files changed, 335 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_cper.c b/drivers/gpu/drm/xe/xe_cper.c
> index dda82eb4690c..7366e17b6ebc 100644
> --- a/drivers/gpu/drm/xe/xe_cper.c
> +++ b/drivers/gpu/drm/xe/xe_cper.c
> @@ -89,7 +89,7 @@ static u64 cper_timestamp_now(void)
>  
>  static void cper_init_intel_hdr(struct xe_device *xe, const struct xe_ras_error_class *counter,
>  				u64 first_timestamp, u32 sig_id, u32 error_count,
> -				struct xe_cper_intel_hdr *ihdr)
> +				u32 einfo_size, struct xe_cper_intel_hdr *ihdr)
>  {
>  	ihdr->counter = *counter;
>  	ihdr->validation_bits |= XE_CPER_VALID_LOCATION;
> @@ -106,6 +106,7 @@ static void cper_init_intel_hdr(struct xe_device *xe, const struct xe_ras_error_
>  	}
>  
>  	ihdr->error_count = error_count;
> +	ihdr->info_log_size = einfo_size;

s/info_log_size/einfo_size

>  	strscpy(ihdr->pci_bdf, pci_name(to_pci_dev(xe->drm.dev)), sizeof(ihdr->pci_bdf));
>  	ihdr->validation_bits |= XE_CPER_VALID_PCI_BDF;
> @@ -200,6 +201,226 @@ static void cper_record_emit(struct xe_device *xe, u8 severity,
>  	kfree(rec);
>  }
>  
> +static struct xe_cper_intel_info *fill_info(const struct xe_ras_error_class *counter,

Considering we're returning xe_cper_intel_info, we should probably call
this fill_einfo().

> +					    u32 error_count, const struct xe_ras_error_log *logs,
> +					    u32 num_logs)
> +{
> +	struct xe_cper_intel_event *entry;

I'm getting a bit confused by 'entry' since we aready use it for
xe_cper_info_entry, so let's call this 'event'.

> +	struct xe_cper_intel_info *einfo;
> +	u32 event_queue_size, i;
> +
> +	event_queue_size = num_logs * XE_CPER_RAS_LOG_ENTRY_SIZE;
> +	einfo = kzalloc_flex(*einfo, event_queue, event_queue_size);
> +	if (!einfo)
> +		return NULL;
> +
> +	einfo->error_count = error_count;
> +	einfo->event_queue_size = event_queue_size;
> +	einfo->event_queue_count = num_logs;
> +	einfo->counter = *counter;
> +
> +	entry = (struct xe_cper_intel_event *)einfo->event_queue;
> +	for (i = 0; i < num_logs; i++) {
> +		entry->size = sizeof_field(struct xe_ras_error_log, details);
> +		entry->timestamp = logs[i].timestamp;
> +		memcpy(entry->metadata, logs[i].details, sizeof(logs[i].details));
> +		entry = (void *)entry + XE_CPER_RAS_LOG_ENTRY_SIZE;

This looks like we're iterating over the events and should be called
XE_CPER_INTEL_EVEN_SIZE.

Sorry I missed this in last rev.

Raag

> +	}
> +
> +	return einfo;
> +}

  reply	other threads:[~2026-11-20 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  4:33 [PATCH v8 0/3] Extend CPER records with RAS info queue data Badal Nilawar
2026-11-20  4:33 ` [PATCH v8 1/3] drm/xe/cper: Drop redundant counter argument Badal Nilawar
2026-11-20  4:33 ` [PATCH v8 2/3] drm/xe/xe_ras: Add support to retrieve info queue data Badal Nilawar
2026-11-20  4:42   ` sashiko-bot
2026-11-20  7:54     ` Raag Jadav
2026-11-20  6:09   ` Raag Jadav
2026-11-20  4:33 ` [PATCH v8 3/3] drm/xe/cper: Prepare Intel CPER info records Badal Nilawar
2026-11-20 11:19   ` Raag Jadav [this message]
2026-11-20  6:13 ` ✓ CI.KUnit: success for Extend CPER records with RAS info queue data (rev3) 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=awAspuvr9q8Eav8r@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@intel.com \
    --cc=arvind.yadav@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=nitin.r.gote@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=syed.abdul.muqthyar.ahmed@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.