Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: tilak.tirumalesh.tangudu@intel.com
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/xe: Add wa_14025941587 to xe2, xe3 and xe3p platforms
Date: Wed, 09 Sep 2026 16:33:07 +0000	[thread overview]
Message-ID: <20260909163307.8AA771F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260909161844.125147-3-tilak.tirumalesh.tangudu@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Tick quantization rounding up causes `idledly` to exceed `maxcnt`, triggering spurious kernel warnings and WA invariant violations.
--

commit d777113f52ced7ebda03cbb9155258701e427a45
Author: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com>

drm/xe: Add wa_14025941587 to xe2, xe3 and xe3p platforms

This commit avoids programming the IDLEDLY timer to less than 5 microseconds.
It applies wa_14025941587 to Graphics Versions 20.01 to 35.11 and Media
Versions 13.01 to 35.03.

> diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> index c86890e09b555..37cd7fe38c2b5 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
[ ... ]
> @@ -588,33 +588,78 @@ static void hw_engine_init_early(struct xe_gt *gt, struct xe_hw_engine *hwe,
>  static void adjust_idledly(struct xe_hw_engine *hwe)
>  {
>  	struct xe_gt *gt = hwe->gt;
[ ... ]
> +		if (XE_GT_WA(gt, 16023105232) &&
> +		    xe_gt_WARN_ON(gt, idledly >= maxcnt || inhibit_switch)) {
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[Severity: Medium]
Will this warning spuriously fire on subsequent reads?

If maxcnt is unprogrammed (0), the two workarounds conflict entirely (one
forcing 5000, the other forcing 0), which would cause a WARN_ON and clamp
cycle on every reset.

Additionally, if maxcnt tightly bounds the 5000ns minimum, the tick
quantization rounding up below can push the delay time above maxcnt. On the
next engine reset or resume, this triggers this xe_gt_WARN_ON() and forces a
clamp, causing idledly to oscillate and violate the invariants of
Wa_16023105232.

> +			/* maxcnt may be 0 if IDLE_WAIT_TIME is unprogrammed. */
> +			idledly = maxcnt ? maxcnt - 1 : 0;
> +			clamped_below_maxcnt = true;
> +			wa_applied = true;
> +			/* inhibit_switch override to keep
> +			 * semantics of Wa_16023105232
> +			 */
> +			if (inhibit_switch)
> +				idledly_reg_val &= ~INHIBIT_SWITCH_UNTIL_PREEMPTED;
> +		}
> +
> +		if (wa_applied) {
> +			u32 idledly_ticks;
> +
> +			/*
> +			 * Wa_16023105232 requires idledly < maxcnt, so floor
> +			 * that clamp; otherwise round up to guarantee the
> +			 * Wa_14025941587 minimum survives tick quantization.
> +			 */
> +			if (clamped_below_maxcnt)
> +				idledly_ticks = DIV_ROUND_DOWN_ULL((u64)idledly * 1000,
> +								   idledly_units_ps);
> +			else
> +				idledly_ticks = DIV_ROUND_UP_ULL((u64)idledly * 1000,
> +								 idledly_units_ps);
                                                                 ^^^^^^^^^^^^^^^^^^

[Severity: Medium]
Does this ceiling division push the delay time above the maxcnt boundary?

When maxcnt is close to the 5000ns minimum (e.g. 5120ns), rounding up idledly
to ticks produces a delay (e.g. 5417ns) that exceeds maxcnt, storing a value
that will fail the Wa_16023105232 check on the next read.

> +
> +			idledly_reg_val &= ~IDLE_DELAY;
> +			idledly_reg_val |= REG_FIELD_PREP(IDLE_DELAY, idledly_ticks);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260909161844.125147-1-tilak.tirumalesh.tangudu@intel.com?part=2

  reply	other threads:[~2026-09-09 16:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 16:18 [PATCH 0/2] drm/xe: Add wa_14025941587 to xe2, xe3 and xe3p platforms tilak.tirumalesh.tangudu
2026-09-09 16:18 ` [PATCH 1/2] drm/xe: harden adjust_idledly() against divide-by-zero and overflow tilak.tirumalesh.tangudu
2026-09-11 17:39   ` Belgaumkar, Vinay
2026-09-11 17:44     ` Tangudu, Tilak Tirumalesh
2026-09-11 17:47       ` Belgaumkar, Vinay
2026-09-09 16:18 ` [PATCH 2/2] drm/xe: Add wa_14025941587 to xe2, xe3 and xe3p platforms tilak.tirumalesh.tangudu
2026-09-09 16:33   ` sashiko-bot [this message]
2026-09-09 17:06     ` Tangudu, Tilak Tirumalesh
2026-09-11 21:32   ` Belgaumkar, Vinay
2026-09-09 17:06 ` ✓ CI.KUnit: success for drm/xe: Add wa_14025941587 to xe2, xe3 and xe3p platforms (rev9) Patchwork
2026-09-09 17:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-10  2:45 ` ✓ Xe.CI.FULL: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-09-09  7:25 [PATCH 0/2] drm/xe: Add wa_14025941587 to xe2, xe3 and xe3p platforms tilak.tirumalesh.tangudu
2026-09-09  7:25 ` [PATCH 2/2] " tilak.tirumalesh.tangudu
2026-09-09  7:39   ` sashiko-bot

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=20260909163307.8AA771F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tilak.tirumalesh.tangudu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox