Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v7 7/9] drm/xe/sysctrl: Improve firmware response error logging
Date: Mon, 07 Sep 2026 11:03:35 +0000	[thread overview]
Message-ID: <20260907110335.9DA561F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260907105313.2208003-18-mallesh.koujalagi@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Passing restricted `__le32` fields to the `%x` format specifier causes Sparse warnings and prints byte-swapped values on big-endian architectures.
--

commit 76127f4976105bb1328499efbd66f71de155b1ba
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>

drm/xe/sysctrl: Improve firmware response error logging

This commit updates the error logging in sysctrl_receive_frames() to use
the xe_log_err() helper. It also includes additional details such as the
response header values when a firmware response mismatch occurs.

> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> index cdd929ebed4a6..94ed2d378b89a 100644
> --- a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> @@ -233,13 +233,15 @@ static int sysctrl_receive_frames(struct xe_sysctrl *sc,
>  	if (!XE_SYSCTRL_HDR_IS_RESPONSE(hdr) ||
>  	    XE_SYSCTRL_HDR_GROUP_ID(hdr) != XE_SYSCTRL_HDR_GROUP_ID(req) ||
>  	    XE_SYSCTRL_HDR_COMMAND(hdr) != XE_SYSCTRL_HDR_COMMAND(req)) {
> -		xe_err(xe, "sysctrl: Response header mismatch\n");
> +		xe_log_err(xe, SYSCTRL, -EPROTO,
> +			   "Response header mismatch: %#x != %#x\n",
> +			   hdr->data, req->data);

[Severity: Low]
Does this code cause Sparse warnings and print byte-swapped values on big-endian
architectures?

In sysctrl_receive_frames() in xe_sysctrl_mailbox.c, hdr->data and req->data
appear to be restricted __le32 types (based on their use with le32_to_cpu() in
the XE_SYSCTRL_HDR_* macros). Passing them directly to the %#x format specifier
without endianness conversion or casting will cause Sparse to emit warnings
about type mismatches ("incorrect type in argument ... expected unsigned int,
got restricted __le32").

On big-endian systems, they will be interpreted as native integers by the
format string parser, printing byte-swapped values.

While the v7 changelog notes that le32_to_cpu() was explicitly removed, a
(__force u32) cast might still be needed if the raw value is intended to be
printed without triggering Sparse warnings.

>  		return -EPROTO;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907105313.2208003-11-mallesh.koujalagi@intel.com?part=7

  reply	other threads:[~2026-09-07 11:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 10:53 [PATCH v7 0/9] drm/xe/sysctrl: Clean up error handling in Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 1/9] drm/xe/sysctrl: Return error codes from sysctrl_wait_bit_clear() Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 2/9] drm/xe/sysctrl: Return error codes from sysctrl_wait_bit_set() Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 3/9] drm/xe/sysctrl: Make sysctrl_write_frame() void Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 4/9] drm/xe/sysctrl: Make sysctrl_read_frame() void Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 5/9] drm/xe/sysctrl: Use xe_assert() for payload size validation Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 6/9] drm/xe/sysctrl: Replace FIELD_GET() with REG_FIELD_GET() Mallesh Koujalagi
2026-09-07 11:04   ` sashiko-bot
2026-09-07 11:47   ` Michal Wajdeczko
2026-09-07 12:07     ` Mallesh, Koujalagi
2026-09-07 14:07       ` Michal Wajdeczko
2026-09-08  7:36         ` Mallesh, Koujalagi
2026-09-07 10:53 ` [PATCH v7 7/9] drm/xe/sysctrl: Improve firmware response error logging Mallesh Koujalagi
2026-09-07 11:03   ` sashiko-bot [this message]
2026-09-07 10:53 ` [PATCH v7 8/9] drm/xe/sysctrl: Log group and command ID on mailbox failure Mallesh Koujalagi
2026-09-07 10:53 ` [PATCH v7 9/9] drm/xe/sysctrl: Report 'System Controller event' error using SIGID Mallesh Koujalagi
2026-09-07 12:19 ` ✓ CI.KUnit: success for drm/xe/sysctrl: Clean up error handling in (rev4) Patchwork
2026-09-08  8:05 ` Patchwork
2026-09-08 10:30 ` ✓ CI.KUnit: success for drm/xe/sysctrl: Clean up error handling in (rev5) Patchwork
2026-09-08 11:28 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-08 14:15 ` ✓ 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=20260907110335.9DA561F00A3D@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox