From: sashiko-bot@kernel.org
To: "Zongyao Bai" <zongyao.bai@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 2/3] drm/xe/forcewake: flush delayed release at power and teardown boundaries
Date: Tue, 10 Nov 2026 22:26:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-207828@kernel.org> (raw)
In-Reply-To: <20261110220542.432595-3-zongyao.bai@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/xe/forcewake: delayed domains stranded if runtime suspend
aborts
--
commit f7553aeb9060950e90243740fda0d4e4ec003892
Author: Zongyao Bai <zongyao.bai@intel.com>
drm/xe/forcewake: flush delayed release at power and teardown boundaries
This commit adds xe_force_wake_flush() and xe_force_wake_stop() to cancel
delayed forcewake releases and put delayed domains to sleep across suspend,
shutdown, and device removal paths.
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 5ed96807fe342..a0a238f1a4515 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
[ ... ]
> @@ -1104,7 +1106,7 @@ int xe_gt_runtime_suspend(struct xe_gt *gt)
> {
> xe_gt_dbg(gt, "runtime suspending\n");
>
> - CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> + CLASS(xe_force_wake_flush, fw_ref)(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> if (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FORCEWAKE_ALL)) {
> xe_gt_err(gt, "runtime suspend failed (%pe)\n", ERR_PTR(-ETIMEDOUT));
> return -ETIMEDOUT;
[Severity: Medium]
Can an aborted runtime suspend leave fw->delayed_domains awake with no
worker pending?
Once rpm_suspend() sets the device status to RPM_SUSPENDING,
xe_pm_runtime_get_if_active() returns false, so
xe_force_wake_delayed_release_work() exits early without sleeping
fw->delayed_domains or requeuing itself, relying on the suspend flush here
and in xe_gt_suspend().
However, xe_pm_runtime_suspend() can fail before reaching this flush on all
GTs:
drivers/gpu/drm/xe/xe_pm.c:xe_pm_runtime_suspend() {
...
if (xe->d3cold.allowed) {
err = xe_bo_evict_all(xe);
if (err)
goto out_resume;
}
for_each_gt(gt, xe, id) {
err = xe->d3cold.allowed ? xe_gt_suspend(gt) : xe_gt_runtime_suspend(gt);
if (err)
goto out_resume;
}
...
}
If xe_bo_evict_all() fails, or an earlier GT fails in the loop, rpm_suspend()
restores the device status to RPM_ACTIVE without flushing the remaining GTs.
Any domain in fw->delayed_domains whose worker ran during the RPM_SUSPENDING
window then stays awake with ref == 0 and delayed_release_work inactive,
violating the DELAYED HOLD invariant documented in struct xe_force_wake and
preventing GT C6 power saving until a later forcewake access or suspend.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261110220542.432595-1-zongyao.bai@intel.com?part=2
next prev parent reply other threads:[~2026-11-10 22:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 3:18 [PATCH 0/3] drm/xe/forcewake: add delayed release for engine-cycle queries Zongyao Bai
2026-10-17 3:18 ` [PATCH 1/3] drm/xe/forcewake: add delayed release with hysteresis Zongyao Bai
2026-11-09 20:55 ` Rodrigo Vivi
2026-11-10 1:00 ` Bai, Zongyao
2026-10-17 3:18 ` [PATCH 2/3] drm/xe/forcewake: flush delayed release at power and teardown boundaries Zongyao Bai
2026-10-17 3:18 ` [PATCH 3/3] drm/xe/query: use delayed forcewake release for engine-cycle queries Zongyao Bai
2026-10-17 3:25 ` ✗ CI.checkpatch: warning for drm/xe/forcewake: add delayed " Patchwork
2026-10-17 3:27 ` ✓ CI.KUnit: success " Patchwork
2026-10-17 3:27 ` [PATCH 0/3] " Simon Richter
2026-10-17 4:07 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-10-17 5:48 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-10 22:05 ` [PATCH v2 0/3] " Zongyao Bai
2026-11-10 22:05 ` [PATCH v2 1/3] drm/xe/forcewake: add delayed release with hysteresis Zongyao Bai
2026-11-10 22:34 ` sashiko-bot
2026-11-10 22:05 ` [PATCH v2 2/3] drm/xe/forcewake: flush delayed release at power and teardown boundaries Zongyao Bai
2026-11-10 22:26 ` sashiko-bot [this message]
2026-11-10 22:05 ` [PATCH v2 3/3] drm/xe/query: use delayed forcewake release for engine-cycle queries Zongyao Bai
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-207828@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zongyao.bai@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