All of 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 v5 6/7] drm/xe/sysctrl: Log group and command ID on mailbox failure
Date: Tue, 25 Aug 2026 11:21:34 +0000	[thread overview]
Message-ID: <20260825112134.C4C3C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825110542.1359776-15-mallesh.koujalagi@intel.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [Low] Undeclared macro xe_log_err and missing xe_log.h cause a build failure.
- [Low] Missing include for REG_FIELD_GET in header file.

Pre-existing issues:
- [High] Incorrect endianness conversion in mailbox frame read and write functions on big-endian architectures.
--

--- Patch [6]: [PATCH v5 6/7] drm/xe/sysctrl: Log group and command ID on mailbox failure ---
commit 1b3f6de8bafa26d44086972155e85f862cc56e97
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>

drm/xe/sysctrl: Log group and command ID on mailbox failure

Include the mailbox group ID and command code in error logs
for command preparation and execution failures.

> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> index 5032d766b3142..f55f72fce9946 100644
> --- a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> @@ -373,7 +373,8 @@ int xe_sysctrl_send_command(struct xe_sysctrl *sc,
>  				      cmd->data_in, cmd->data_in_len,
>  				      &mbox_cmd, &cmd_size);
>  	if (ret) {
> -		xe_err(xe, "sysctrl: Failed to prepare command: %pe\n", ERR_PTR(ret));
> +		xe_log_err(xe, SYSCTRL, ret, "Failed to prepare command %#x.%#x\n",
> +			   group_id, command_code);

[Severity: Low]
Does this cause a build failure? I couldn't find the definition for the
xe_log_err macro or the xe_log.h header in the tree.

>  		return ret;
>  	}
>  

[ ... ]

> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> index fb434cc165b2a..df7dfe3b39e24 100644
> --- a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> @@ -15,13 +15,13 @@ struct xe_sysctrl;
>  struct xe_sysctrl_mailbox_command;
>  
>  #define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \
> -	FIELD_GET(APP_HDR_GROUP_ID_MASK, (hdr)->data)
> +	REG_FIELD_GET(APP_HDR_GROUP_ID_MASK, (hdr)->data)

[Severity: Low]
Is a #include <drm/intel/reg_bits.h> missing here? Any file including this
header might fail to build if it doesn't already include the definition
for REG_FIELD_GET.

[ ... ]

[Severity: High]
This isn't a bug introduced by this patch, but does the endianness conversion
in the mailbox frame read and write functions work correctly on big-endian
architectures?

In sysctrl_write_frame(), the byte stream is copied into a host-endian u32
array and then written to the little-endian MMIO register:

	memcpy(val, frame, len);

	for (i = 0; i < dw; i++)
		xe_mmio_write32(sc->mmio, regs[i], val[i]);

Similarly, in sysctrl_read_frame(), the register is read as little-endian
into a host-endian u32 array and then copied to a byte stream:

	for (i = 0; i < dw; i++)
		val[i] = xe_mmio_read32(sc->mmio, regs[i]);

	memcpy(frame, val, len);

This might cause the bytes to be reversed again by xe_mmio_write32() and
xe_mmio_read32() on big-endian systems, potentially leading to firmware
communication failures.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825110542.1359776-9-mallesh.koujalagi@intel.com?part=6

  reply	other threads:[~2026-08-25 11:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 11:05 [PATCH v5 0/7] drm/xe/sysctrl: Clean up error handling in Mallesh Koujalagi
2026-08-25 11:05 ` [PATCH v5 1/7] drm/xe/sysctrl: Return error codes from sysctrl_wait_bit_clear() Mallesh Koujalagi
2026-08-25 11:24   ` sashiko-bot
2026-08-25 11:05 ` [PATCH v5 2/7] drm/xe/sysctrl: Return error codes from sysctrl_wait_bit_set() Mallesh Koujalagi
2026-08-25 11:24   ` sashiko-bot
2026-08-25 11:05 ` [PATCH v5 3/7] drm/xe/sysctrl: Make sysctrl_write_frame() void Mallesh Koujalagi
2026-08-25 11:05 ` [PATCH v5 4/7] drm/xe/sysctrl: Use xe_assert() for payload size validation Mallesh Koujalagi
2026-08-25 11:05 ` [PATCH v5 5/7] drm/xe/sysctrl: Improve firmware response error logging Mallesh Koujalagi
2026-08-25 11:22   ` sashiko-bot
2026-08-27 10:57   ` Michal Wajdeczko
2026-08-27 12:50     ` Mallesh, Koujalagi
2026-08-27 14:40       ` Michal Wajdeczko
2026-08-25 11:05 ` [PATCH v5 6/7] drm/xe/sysctrl: Log group and command ID on mailbox failure Mallesh Koujalagi
2026-08-25 11:21   ` sashiko-bot [this message]
2026-08-27 11:01   ` Michal Wajdeczko
2026-08-25 11:05 ` [PATCH v5 7/7] drm/xe/sysctrl: Report 'System Controller event' error using SIGID Mallesh Koujalagi
2026-08-25 11:18   ` sashiko-bot
2026-08-27 11:06   ` Michal Wajdeczko
2026-08-25 11:13 ` ✓ CI.KUnit: success for drm/xe/sysctrl: Clean up error handling in (rev2) Patchwork
2026-08-25 11:50 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-25 16:29 ` ✗ Xe.CI.FULL: failure " 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=20260825112134.C4C3C1F000E9@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.