From: sashiko-bot@kernel.org
To: "Badal Nilawar" <badal.nilawar@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v7 2/3] drm/xe/xe_ras: Add support to retrieve info queue data
Date: Tue, 17 Nov 2026 07:31:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-218355@kernel.org> (raw)
In-Reply-To: <20261117072118.4051706-7-badal.nilawar@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/xe/ras: false xe_assert() in get_remaining_chunks() on
single chunk
- [Low] drm/xe/ras: missing @xe kernel-doc in
xe_ras_get_info_queue_size()
--
commit 99a89cb129918412b7f5d01c7623b004ecfade2f
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 from the system controller 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..0a5bac375d8c3 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -1123,6 +1123,190 @@ int xe_ras_set_threshold(struct xe_device *xe, u8 severity, u8 component, u32 th
[ ... ]
> +static bool chunk_is_valid(const struct xe_ras_info_queue_header *hdr,
> + u32 expected_offset, u32 total_size, u32 dest_size)
> +{
> + u32 end;
> +
> + return hdr->total_size == total_size && total_size &&
> + hdr->chunk_offset == expected_offset &&
> + hdr->chunk_size && hdr->chunk_size <= XE_RAS_INFO_QUEUE_MAX_CHUNK_SIZE &&
> + !check_add_overflow(hdr->chunk_offset, hdr->chunk_size, &end) &&
> + end <= min_t(u32, total_size, XE_RAS_INFO_QUEUE_MAX_TOTAL_SIZE) &&
> + end <= dest_size;
> +}
> +
> +static u32 get_first_chunk(struct xe_device *xe,
> + const struct xe_ras_get_counter_response *counter_resp,
> + u8 *dest_buf, u32 dest_size, u32 *flags)
> +{
> + const struct xe_ras_info_queue_header *hdr = &counter_resp->first.header;
> +
> + if (!chunk_is_valid(hdr, 0, hdr->total_size, dest_size)) {
> + xe_warn(xe, "[RAS]: invalid first info queue chunk (total=%u offset=%u size=%u, expected offset=0)\n",
> + hdr->total_size, hdr->chunk_offset, hdr->chunk_size);
> + return 0;
> + }
> +
> + memcpy(dest_buf, counter_resp->first.data, hdr->chunk_size);
> + *flags = hdr->flags;
> +
> + return hdr->chunk_size;
> +}
> +
> +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;
> +
> + xe_assert(xe, offset < dest_size);
> +
> + while ((flags & XE_RAS_INFO_QUEUE_FLAG_MORE_DATA) && offset < dest_size) {
[Severity: Medium]
Won't xe_assert(xe, offset < dest_size) fire on every single-chunk info
queue when CONFIG_DRM_XE_DEBUG is enabled?
When the entire info queue fits in the first chunk and the caller sizes
dest_buf from xe_ras_get_info_queue_size(), get_first_chunk() copies
hdr->chunk_size == dest_size bytes and returns offset == dest_size, after
which xe_ras_drain_info_queue() unconditionally calls
get_remaining_chunks() even when XE_RAS_INFO_QUEUE_FLAG_MORE_DATA is clear.
[ ... ]
> +/**
> + * xe_ras_get_info_queue_size() - Get the total size of the RAS info queue
> + * @response: Counter response carrying the first info queue chunk
> + *
> + * Return: Info queue size in bytes, capped at the supported maximum, or zero
> + * if no usable info queue is present.
> + */
> +u32 xe_ras_get_info_queue_size(struct xe_device *xe,
> + const struct xe_ras_get_counter_response *response)
[Severity: Low]
The kernel-doc comment for xe_ras_get_info_queue_size() is missing a
description for the @xe parameter, which triggers a W=1 kernel-doc warning.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117072118.4051706-5-badal.nilawar@intel.com?part=2
next prev parent reply other threads:[~2026-11-17 7:31 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 [this message]
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
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-218355@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.