Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stuart Summers" <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 01/16] drm/xe/sysctrl: Use preallocated mailbox staging buffers
Date: Fri, 20 Nov 2026 05:52:59 +0000	[thread overview]
Message-ID: <sashiko-outbox-224518@kernel.org> (raw)
In-Reply-To: <20261120054712.377573-19-stuart.summers@intel.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/xe: firmware mailbox hang in sysctrl_receive_frames() [1]
--

commit ee97ee7c6a82e33cb4ded6d0131b1da9156a60a6
Author: Stuart Summers <stuart.summers@intel.com>

drm/xe/sysctrl: Use preallocated mailbox staging buffers

This commit embeds preallocated request and response staging buffers into
struct xe_sysctrl, protected by cmd_lock, to avoid GFP_KERNEL allocations
when sending mailbox commands.

> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> index f1a231dfec1e9..2af73c62d32db 100644
> --- a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c

[ ... ]

> @@ -231,14 +221,17 @@ static int sysctrl_receive_frames(struct xe_sysctrl *sc,
>  	struct xe_sysctrl_mailbox_msg_hdr *hdr;
>  	struct xe_device *xe = sc_to_xe(sc);
>  	size_t remain = sizeof(*hdr) + data_out_len;
> -	u8 *buffer __free(kfree) = kzalloc(remain, GFP_KERNEL);
> +	u8 *buffer = sc->resp_buf;
>  	size_t frame_size;
>  	bool done = false;
>  	int ret = 0;
>  	u8 *out;
>  
> -	if (!buffer)
> -		return -ENOMEM;
> +	lockdep_assert_held(&sc->cmd_lock);
> +
> +	xe_assert(xe, data_out_len <= XE_SYSCTRL_MB_MAX_MESSAGE_SIZE - sizeof(*hdr));
> +
> +	memset(buffer, 0, remain);
>  
>  	out = buffer;
>  	while (!done && remain) {

[Severity: High]
This problem wasn't introduced by this patch, but can the receive loop in
sysctrl_receive_frames() hang the firmware mailbox state machine [1]
if the firmware sends a response payload larger than data_out_len?

When remain reaches 0 before the hardware signals completion via done, the
loop exits early and stops calling sysctrl_process_frame() to clear
SYSCTRL_MB_CTRL_RUN_BUSY_OUT.  Because the remaining frames are neither
drained nor acknowledged, the mailbox state machine stalls and subsequent
xe_sysctrl_send_command() calls time out until a device reset.

[1] https://sashiko.dev/#/bug/linux-3329046e-adfb-4ef5-8005-36eb041a2bbd

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120054712.377573-18-stuart.summers@intel.com?part=1

  reply	other threads:[~2026-11-20  5:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  5:47 [PATCH 00/16] Work around media 52-bit limitation on CRI Stuart Summers
2026-11-20  5:47 ` [PATCH 01/16] drm/xe/sysctrl: Use preallocated mailbox staging buffers Stuart Summers
2026-11-20  5:52   ` sashiko-bot [this message]
2026-11-20  5:47 ` [PATCH 02/16] drm/xe: Process device OOB workarounds during early info init Stuart Summers
2026-11-20  5:47 ` [PATCH 03/16] drm/xe/sysctrl: Restore the SoC remapper on every runtime resume Stuart Summers
2026-11-20  5:47 ` [PATCH 04/16] drm/xe: Add enable_media module parameter Stuart Summers
2026-11-20  5:47 ` [PATCH 05/16] drm/xe: Detect each GMD_ID IP in a loop Stuart Summers
2026-11-20  5:47 ` [PATCH 06/16] drm/xe: Tolerate a missing graphics IP in xe_info_init() Stuart Summers
2026-11-20  5:47 ` [PATCH 07/16] drm/xe: Verify IP presence against GU_CNTL Stuart Summers
2026-11-20  5:47 ` [PATCH 08/16] drm/xe: Guard per-tile primary GT accesses Stuart Summers
2026-11-20  5:47 ` [PATCH 09/16] drm/xe: Stop assuming the root tile has a primary GT Stuart Summers
2026-11-20  5:47 ` [PATCH 10/16] drm/xe: Do not claim flat CCS without a graphics IP Stuart Summers
2026-11-20  5:47 ` [PATCH 11/16] drm/xe: Run page table updates on the media GT when there is no primary Stuart Summers
2026-11-20  6:10   ` sashiko-bot
2026-11-20  5:47 ` [PATCH 12/16] drm/xe: Document that gt_types_allowed=media now probes Stuart Summers
2026-11-20  5:47 ` [PATCH 13/16] drm/xe: Fall back to CPU copies when the tile cannot blit Stuart Summers
2026-11-20  6:09   ` sashiko-bot
2026-11-20  5:47 ` [PATCH 14/16] drm/xe: Require a fully visible VRAM BAR without a primary GT Stuart Summers
2026-11-20  5:47 ` [PATCH 15/16] drm/xe: Allow probe " Stuart Summers
2026-11-20  6:13   ` sashiko-bot
2026-11-20  5:47 ` [PATCH 16/16] drm/xe: Work around media 52-bit limitation on CRI Stuart Summers
2026-11-20  6:11   ` 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=sashiko-outbox-224518@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=stuart.summers@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