All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Himal Prasad Ghimiray" <himal.prasad.ghimiray@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout
Date: Mon, 23 Nov 2026 12:38:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-229237@kernel.org> (raw)
In-Reply-To: <20261123123436.2114961-3-himal.prasad.ghimiray@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/guc: infinite retry loop on signal in
  guc_exec_queue_wait_suspend_done() [1]
--

commit fc6166f7ac4a1298d1151f0d015f326ad4272c09
Author: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

drm/xe/guc: Scale suspend wait timeout with preempt timeout

This commit extends the suspend wait timeout in
guc_exec_queue_wait_suspend_done() by adding preempt_timeout_us and
min_run_period_ms on top of the 5-second base timeout.

> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index b5c916a764dbe..8b645fb17a2b0 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -2542,7 +2542,20 @@ static int guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
[ ... ]
> @@ -2556,16 +2569,16 @@ static int guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
>  retry:
>  	if (blocking) {
>  		if (IS_SRIOV_VF(xe))
> -			ret = wait_event_timeout(guc->ct.wq, WAIT_COND, HZ * 5);
> +			ret = wait_event_timeout(guc->ct.wq, WAIT_COND, timeout);
>  		else
>  			ret = wait_event_timeout(q->guc->suspend_wait, WAIT_COND,
> -						 HZ * 5);
> +						 timeout);
>  	} else if (IS_SRIOV_VF(xe)) {
>  		ret = wait_event_interruptible_timeout(guc->ct.wq, WAIT_COND ||
> -						       vf_recovery(guc), HZ * 5);
> +						       vf_recovery(guc), timeout);
>  	} else {
>  		ret = wait_event_interruptible_timeout(q->guc->suspend_wait,
> -						       WAIT_COND, HZ * 5);
> +						       WAIT_COND, timeout);
>  	}
>  
>  	if (!blocking && vf_recovery(guc) && !xe_wedged(xe))

[Severity: High]
This problem wasn't introduced by this patch, but can
guc_exec_queue_wait_suspend_done() enter a tight retry loop on an SR-IOV
VF when interrupted by a signal [1]?

drivers/gpu/drm/xe/xe_guc_submit.c:guc_exec_queue_wait_suspend_done() {
    ...
	if (!ret)
		return -ETIME;
	else if (!blocking && IS_SRIOV_VF(xe) && !WAIT_COND)
		/* Corner case on RESFIX DONE where vf_recovery() changes */
		goto retry;

#undef WAIT_COND

	return ret < 0 ? ret : 0;
}

When a signal arrives during the interruptible wait while suspend_pending
is set and vf_recovery(guc) is false, wait_event_interruptible_timeout()
returns -ERESTARTSYS.  Because the retry condition does not check ret > 0,
it jumps back to retry instead of returning -ERESTARTSYS, and subsequent
calls return -ERESTARTSYS immediately while the signal remains pending,
spinning with group->mode_sem write-locked until the GuC suspend finishes
or a soft lockup occurs.

[1] https://sashiko.dev/#/bug/linux-0dd652ca-b4ef-464d-b05e-1a1b1bb61630

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123123436.2114961-3-himal.prasad.ghimiray@intel.com?part=1

  parent reply	other threads:[~2026-11-23 12:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 12:34 [PATCH 1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout Himal Prasad Ghimiray
2026-11-23 12:34 ` [PATCH 2/2] drm/xe/cri: Increase default CCS preempt timeout to 7.5s Himal Prasad Ghimiray
2026-11-24 11:38   ` Matthew Auld
2026-12-01  0:19   ` Matt Roper
2026-11-23 12:38 ` sashiko-bot [this message]
2026-11-23 13:11 ` [PATCH 1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout Matthew Auld
2026-11-23 14:46 ` ✗ CI.KUnit: failure for series starting with [1/2] " Patchwork
2026-11-26 12:01 ` ✓ CI.KUnit: success for series starting with [1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout (rev2) Patchwork
2026-11-26 12:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-26 18:29 ` ✓ 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=sashiko-outbox-229237@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --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.