From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 2/3] drm/xe/pcode: Improve PCODE logging using xe_log helper
Date: Wed, 12 Aug 2026 12:44:01 +0000 [thread overview]
Message-ID: <20260812124402.4C0251F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812123449.239480-7-mallesh.koujalagi@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] Incomplete migration to xe_log_err for PCODE errors
Pre-existing issues:
- [High] Unbounded exponential backoff in PCODE polling loop causes massive sleeps and dangerous udelay() calls
--
--- Patch [2]: [PATCH v2 2/3] drm/xe/pcode: Improve PCODE logging using xe_log helper ---
commit be49e77e4b5b367f065e60c69fb19b1b95cdf273
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
drm/xe/pcode: Improve PCODE logging using xe_log helper
This commit updates the driver to use the xe_log_err() helper for PCODE
errors instead of drm_err(). This aims to add the PCODE component tag to the
log messages to make issues easier to track.
> Use xe_log helper for PCODE errors instead of drm_err(). This
> adds PCODE component tag, making issues easier to detect and
> track with automated tools.
[Severity: Medium]
Did we miss updating the drm_err() call in pcode_mailbox_status()?
drivers/gpu/drm/xe/xe_pcode.c:pcode_mailbox_status() {
if (err) {
drm_err(&tile_to_xe(tile)->drm, "PCODE Mailbox failed: %d %s",
err_decode, err_str);
return err_decode;
}
...
}
It seems this error logging statement was left unconverted. Leaving it as
drm_err() means automated tools tracking the PCODE component tag might miss
these critical hardware mailbox failures.
> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index ccc3bdeed6bb2..c69440ea477b4 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
[ ... ]
> @@ -219,8 +220,8 @@ int xe_pcode_request(struct xe_tile *tile, u32 mbox, u32 request,
> * requests, and for any quirks of the PCODE firmware that delays
> * the request completion.
> */
> - drm_err(&tile_to_xe(tile)->drm,
> - "PCODE timeout, retrying with preemption disabled\n");
> + xe_log_err(tile, PCODE, -ETIMEDOUT,
> + "Timeout, retrying with preemption disabled\n");
> preempt_disable();
> ret = pcode_try_request(tile, mbox, request, reply_mask, reply, &status,
> true, 50 * 1000, true);
[Severity: High]
This isn't a bug introduced by this patch, but does the polling loop in
pcode_try_request() have an unbounded exponential backoff?
Looking at the pcode_try_request() function called here:
for (slept = 0; slept < timeout_us; slept += wait) {
...
if (atomic)
udelay(wait);
else
usleep_range(wait, wait << 1);
wait <<= 1;
}
Because wait is doubled on every iteration without an upper limit, it
exponentially grows. When called from xe_pcode_request() during a timeout
retry with atomic = true and a 50,000us timeout, wait reaches 32,768us,
resulting in a udelay(32768). Busy-waiting for over 32 milliseconds with
preemption disabled can trigger CPU soft lockups.
Similarly, when pcode_try_request() is called for operations with a 3-minute
timeout (timeout_us = 180000000) during initialization in xe_pcode_ready(),
the wait value grows to over 90 seconds. This causes a massive
usleep_range(90000000, 180000000) that stalls the thread for minutes at a
time without checking the hardware status, which could severely degrade
driver probe times.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812123449.239480-5-mallesh.koujalagi@intel.com?part=2
next prev parent reply other threads:[~2026-08-12 17:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 12:34 [PATCH v2 0/3] drm/xe: Adopt xe_log SIGID API for structured error reporting Mallesh Koujalagi
2026-08-12 12:34 ` [PATCH v2 1/3] drm/xe/log: DO NOT REVIEW Mallesh Koujalagi
2026-08-12 12:49 ` sashiko-bot
2026-08-12 12:34 ` [PATCH v2 2/3] drm/xe/pcode: Improve PCODE logging using xe_log helper Mallesh Koujalagi
2026-08-12 12:44 ` sashiko-bot [this message]
2026-08-12 12:53 ` Bhadane, Dnyaneshwar
2026-08-12 13:10 ` Mallesh, Koujalagi
2026-08-12 18:02 ` Umesh Nerlige Ramappa
2026-08-12 12:34 ` [PATCH v2 3/3] drm/xe/sysctrl: Add better sysctrl error reporting Mallesh Koujalagi
2026-08-12 12:41 ` ✗ CI.checkpatch: warning for drm/xe: Adopt xe_log SIGID API for structured error reporting (rev2) Patchwork
2026-08-12 12:42 ` ✓ CI.KUnit: success " Patchwork
2026-08-12 13:31 ` ✓ Xe.CI.BAT: " 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=20260812124402.4C0251F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=mallesh.koujalagi@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.