All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Badal Nilawar" <badal.nilawar@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v7 3/3] drm/xe/cper: Prepare Intel CPER info records
Date: Tue, 17 Nov 2026 07:34:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-218359@kernel.org> (raw)
In-Reply-To: <20261117072118.4051706-8-badal.nilawar@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/xe/cper: cper_prepare_info() triggers offset < dest_size
  assert on 1-chunk queue
--

commit 18adfa7b4a6578ae8c036862ccea81ff06722754
Author: Badal Nilawar <badal.nilawar@intel.com>

drm/xe/cper: Prepare Intel CPER info records

This commit builds CPER error info payloads from RAS info queue logs for
both detailed and aggregate error counters, and emits a CPER record for
each generated entry.

> diff --git a/drivers/gpu/drm/xe/xe_cper.c b/drivers/gpu/drm/xe/xe_cper.c
> index dda82eb4690cc..7a74fe3aed6ef 100644
> --- a/drivers/gpu/drm/xe/xe_cper.c
> +++ b/drivers/gpu/drm/xe/xe_cper.c

[ ... ]

> @@ -200,6 +201,227 @@ static void cper_record_emit(struct xe_device *xe, u8 severity,

[ ... ]

> +static u8 *cper_get_info_queue_buffer(struct xe_device *xe,
> +				      const struct xe_ras_get_counter_response *counter_resp,
> +				      u32 buf_size, u32 *raw_total)
> +{
> +	u8 *raw_buf;
> +
> +	raw_buf = kzalloc_objs(*raw_buf, buf_size);
> +	if (!raw_buf)
> +		return NULL;
> +
> +	*raw_total = xe_ras_drain_info_queue(xe, counter_resp, raw_buf, buf_size);
> +	if (!*raw_total) {
> +		kfree(raw_buf);
> +		return NULL;
> +	}
> +
> +	return raw_buf;
> +}

[ ... ]

> +static u32
> +cper_prepare_info(struct xe_device *xe,
> +		  const struct xe_ras_get_counter_response *counter_resp,
> +		  struct xe_cper_info_entry **info_arr)
> +{
> +	u32 buf_size, raw_total, num_entries;
> +	u8 *raw_buf;
> +
> +	buf_size = xe_ras_get_info_queue_size(xe, counter_resp);
> +	if (!buf_size)
> +		return 0;
> +
> +	raw_buf = cper_get_info_queue_buffer(xe, counter_resp, buf_size, &raw_total);

[Severity: Medium]
Does calling xe_ras_drain_info_queue() with buf_size set to
xe_ras_get_info_queue_size() trigger an assertion failure in
get_remaining_chunks() whenever the entire info queue fits in the first
chunk?

When total_size <= XE_RAS_INFO_QUEUE_MAX_CHUNK_SIZE, get_first_chunk()
copies the full payload and returns offset == chunk_size == dest_size.
xe_ras_drain_info_queue() then unconditionally calls
get_remaining_chunks():

drivers/gpu/drm/xe/xe_ras.c:get_remaining_chunks() {
	u32 requests_left = XE_SYSCTRL_FLOOD_LIMIT * 2;
	int ret;

	xe_assert(xe, offset < dest_size);
    ...
}

Because offset == dest_size, this hits a drm_WARN splat on every
single-chunk info queue when CONFIG_DRM_XE_DEBUG is enabled.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117072118.4051706-5-badal.nilawar@intel.com?part=3

  reply	other threads:[~2026-11-17  7:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  7:21 [PATCH v7 0/3] Extend CPER records with RAS info queue data Badal Nilawar
2026-11-17  7:21 ` [PATCH v7 1/3] drm/xe/cper: Drop redundant counter argument Badal Nilawar
2026-11-18  6:50   ` Raag Jadav
2026-11-17  7:21 ` [PATCH v7 2/3] drm/xe/xe_ras: Add support to retrieve info queue data Badal Nilawar
2026-11-17  7:31   ` sashiko-bot
2026-11-17  7:21 ` [PATCH v7 3/3] drm/xe/cper: Prepare Intel CPER info records Badal Nilawar
2026-11-17  7:34   ` sashiko-bot [this message]
2026-11-17  7:30 ` ✓ CI.KUnit: success for Extend CPER records with RAS info queue data (rev2) Patchwork
2026-11-17  8:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-17 20:24 ` ✓ 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=sashiko-outbox-218359@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.