All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Riana Tauro" <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/xe/xe_ras: Add support to query page offline queue and list
Date: Tue, 25 Aug 2026 06:50:59 +0000	[thread overview]
Message-ID: <20260825065100.5608C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825063615.3697317-10-riana.tauro@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Comparing cumulatively increasing `count` against a decreasing queue size (`total_pages`) causes spurious failures and prevents fully draining the offline queue.
- [Medium] Un-clamped increment of pagination counter `count` causes silent skipping of offlined pages if firmware returns a large `pages_returned` value.
--

--- Patch [3]: [PATCH 3/5] drm/xe/xe_ras: Add support to query page offline queue and list ---
commit e8cc2bc6a8f50a7f0975b37b113c85a2c4043858
Author: Riana Tauro <riana.tauro@intel.com>

drm/xe/xe_ras: Add support to query page offline queue and list

This commit adds support to query the page offline list and queue from the
firmware during module load. The page offline list retrieves pages already
offlined, and the queue retrieves pages pending to be offlined.

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index a6fa755ffebf7..b320ba6d1d735 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -328,6 +328,102 @@ static bool ras_counter_is_valid(struct xe_device *xe, struct xe_ras_error_class
>  	return true;
>  }
>  
> +static void get_queued_pages(struct xe_device *xe)
> +{

[ ... ]

> +		for (i = 0; i < response.pages_returned && i < XE_RAS_NUM_PAGES; i++)
> +			handle_page_offline(xe, response.page_addresses[i], true);
> +
> +		count += response.pages_returned;

[Severity: Medium]
If the firmware returns a response.pages_returned value greater than
XE_RAS_NUM_PAGES (25), we cap the processing loop at 25 but still add the full
un-clamped response.pages_returned to count. Does this mean we might silently
skip processing some pages?

> +		if (!response.pages_returned)
> +			break;
> +
> +		if (count > response.total_pages) {

[Severity: High]
When handle_page_offline() processes a queued page (with send_cmd=true), it
sends a PAGE_OFFLINE command to the firmware to consume the page. Does this
cause the firmware's remaining queue size (response.total_pages) to decrease
on subsequent loop iterations? 

If count accumulates monotonically while response.total_pages shrinks, will
this check spuriously fail and abort midway through processing a queue that
requires multiple fetches?

> +			xe_log_err(xe, SYSCTRL, -EINVAL,
> +				   "Pages returned from queue exceed total pages %u, returned %u\n",
> +				   response.total_pages, count);
> +			return;
> +		}
> +	} while (response.additional_data);
> +}
> +
> +static void get_offlined_list(struct xe_device *xe)
> +{

[ ... ]

> +		for (i = 0; i < response.pages_returned && i < XE_RAS_NUM_PAGES; i++)
> +			handle_page_offline(xe, response.page_addresses[i], false);
> +
> +		count += response.pages_returned;

[Severity: Medium]
Similar to the issue in get_queued_pages(), if response.pages_returned exceeds
XE_RAS_NUM_PAGES, count increments by the full un-clamped amount.

Since count is subsequently used to set request.index for the next sequence,
will this cause unprocessed entries to be permanently skipped?

> +		if (!response.pages_returned)
> +			break;
> +
> +		if (count > response.total_pages) {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825063615.3697317-7-riana.tauro@intel.com?part=3

  reply	other threads:[~2026-08-25  6:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  6:36 [PATCH 0/5] Add support to handle memory double-bit ecc errors Riana Tauro
2026-08-25  6:36 ` [PATCH 1/5] drm/xe/xe_drm_ras: Rename ras to drm_ras in xe_device Riana Tauro
2026-08-25  6:46   ` sashiko-bot
2026-08-28 15:13   ` Rodrigo Vivi
2026-09-04 10:31     ` Tauro, Riana
2026-08-25  6:36 ` [RFC PATCH 2/5] drm/xe/xe_ras: Handle page offline requests for device memory ecc errors Riana Tauro
2026-08-25  6:49   ` sashiko-bot
2026-09-02  6:30   ` Mallesh, Koujalagi
2026-09-04 10:40     ` Tauro, Riana
2026-09-04 12:55       ` Mallesh, Koujalagi
2026-09-02 16:11   ` Michal Wajdeczko
     [not found]     ` <SJ2PR11MB7619EA09682C7DE8C0A603128CB22@SJ2PR11MB7619.namprd11.prod.outlook.com>
2026-09-07  6:31       ` FW: " Tauro, Riana
2026-09-07 12:23         ` Michal Wajdeczko
2026-09-07 13:40           ` Tauro, Riana
2026-08-25  6:36 ` [PATCH 3/5] drm/xe/xe_ras: Add support to query page offline queue and list Riana Tauro
2026-08-25  6:50   ` sashiko-bot [this message]
2026-09-02  9:56   ` Mallesh, Koujalagi
2026-09-04 10:49     ` Tauro, Riana
2026-08-25  6:36 ` [PATCH 4/5] drm/xe/xe_ras: Add function to get maximum pages firmware can store Riana Tauro
2026-08-25  6:36 ` [PATCH 5/5] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates Riana Tauro
2026-08-25  6:52   ` sashiko-bot
2026-08-25  9:19 ` ✓ CI.KUnit: success for Add support to handle memory double-bit ecc errors Patchwork
2026-08-25  9:57 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-08-25 14:29 ` ✗ Xe.CI.FULL: " Patchwork
2026-08-28 15:15 ` [PATCH 0/5] " Rodrigo Vivi

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=20260825065100.5608C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=riana.tauro@intel.com \
    --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.