Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: sashiko-reviews@lists.linux.dev
Cc: Badal Nilawar <badal.nilawar@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v8 2/3] drm/xe/xe_ras: Add support to retrieve info queue data
Date: Fri, 20 Nov 2026 08:54:46 +0100	[thread overview]
Message-ID: <av_8xkcebltpXt4H@black.igk.intel.com> (raw)
In-Reply-To: <sashiko-outbox-224467@kernel.org>

On Fri, Nov 20, 2026 at 04:42:00AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Medium] drm/xe/ras: assertion and 0-byte fetch in
>   get_remaining_chunks() when full
> --
> 
> commit 6c6fff86d117ac6d5e465e2c1c62372c93a7e520
> Author: Badal Nilawar <badal.nilawar@intel.com>
> 
> drm/xe/xe_ras: Add support to retrieve info queue data
> 
> This commit adds helpers and mailbox structures to retrieve RAS info queue
> data in chunks and assemble it into a flat buffer.
> 
> > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> > index e8984c966876a..46542852e0552 100644
> > --- a/drivers/gpu/drm/xe/xe_ras.c
> > +++ b/drivers/gpu/drm/xe/xe_ras.c
> > @@ -1123,6 +1123,192 @@ int xe_ras_set_threshold(struct xe_device *xe, u8 severity, u8 component, u32 th
> 
> [ ... ]
> 
> > +static u32 get_remaining_chunks(struct xe_device *xe,
> > +				const struct xe_ras_get_counter_response *counter_resp,
> > +				u8 *dest_buf, u32 dest_size, u32 offset, u32 flags)
> > +{
> > +	u32 requests_left = XE_SYSCTRL_FLOOD_LIMIT * 2;
> > +	int ret;
> > +
> > +	while (flags & XE_RAS_INFO_QUEUE_FLAG_MORE_DATA) {
> > +		struct xe_ras_info_queue_data_request *qdata_req;
> > +		struct xe_ras_get_info_queue_response response = {};
> > +		struct xe_ras_get_info_queue_request request = {};
> > +		struct xe_ras_info_queue_header *hdr;
> > +
> > +		xe_assert(xe, offset < dest_size);
> > +
> > +		qdata_req = &request.qdata_req;
> > +		qdata_req->offset = offset;
> > +		qdata_req->size = min_t(u32, XE_RAS_INFO_QUEUE_MAX_CHUNK_SIZE, dest_size - offset);
> > +		qdata_req->session_id = counter_resp->counter;
> > +
> > +		ret = get_info_queue(xe, &request, &response);
> > +		if (ret) {
> > +			xe_err(xe, "[RAS]: info queue drain aborted: fetch at offset=%u, ret = %d\n",
> > +			       offset, ret);
> > +			return offset;
> > +		}
> > +
> > +		hdr = &response.qdata_resp.header;
> > +
> > +		if (!chunk_is_valid(hdr, offset, counter_resp->first.header.total_size,
> > +				    dest_size)) {
> > +			xe_warn(xe, "[RAS]: invalid info queue chunk (total=%u offset=%u size=%u, expected offset=%u)\n",
> > +				hdr->total_size, hdr->chunk_offset, hdr->chunk_size, offset);
> > +			return offset;
> > +		}
> > +
> > +		memcpy(dest_buf + offset, response.qdata_resp.data, hdr->chunk_size);
> > +		offset += hdr->chunk_size;
> > +		flags = hdr->flags;
> > +
> > +		if (!--requests_left) {
> > +			xe_warn(xe, "[RAS]: info queue flooding, aborted at offset=%u\n", offset);
> > +			break;
> > +		}
> > +	}
> 
> [Severity: Medium]
> Can get_remaining_chunks() trip xe_assert(xe, offset < dest_size) and issue
> a 0-byte GET_INFO_QUEUE request when dest_buf fills up while
> XE_RAS_INFO_QUEUE_FLAG_MORE_DATA is still set?

True, the assert should actually be

	xe_assert(xe, offset <= dest_size);

Raag

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

Thread overview: 8+ 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 [this message]
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  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=av_8xkcebltpXt4H@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox