From: sashiko-bot@kernel.org
To: "Zongyao Bai" <zongyao.bai@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [RESEND PATCH v3 1/3] drm/xe/forcewake: add delayed release with hysteresis
Date: Tue, 01 Dec 2026 23:30:20 +0000 [thread overview]
Message-ID: <sashiko-outbox-244390@kernel.org> (raw)
In-Reply-To: <20261201230744.680448-2-zongyao.bai@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/xe/forcewake: unflushed delayed release across PCIe FLR
in xe_gt_flr_prepare()
--
commit 2e2963541af2cb3833279db65dd42d66d442d570
Author: Zongyao Bai <zongyao.bai@intel.com>
drm/xe/forcewake: add delayed release with hysteresis
This commit adds xe_force_wake_put_delay() and a delayed work item to
keep forcewake domains awake for a short hysteresis window after their
last reference is dropped.
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_force_wake.c
> index 197e2197bd0a3..1b69e8e1e8eb1 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake.c
> +++ b/drivers/gpu/drm/xe/xe_force_wake.c
[ ... ]
> @@ -187,8 +223,13 @@ unsigned int __must_check xe_force_wake_get(struct xe_force_wake *fw,
> spin_lock_irqsave(&fw->lock, flags);
> for_each_fw_domain_masked(domain, ref_rqst, fw, tmp) {
> if (!domain->ref++) {
> - awake_rqst |= BIT(domain->id);
> - domain_wake(gt, domain);
> + if (fw->delayed_domains & BIT(domain->id)) {
> + /* Still awake from a delayed release: reuse it. */
> + fw->delayed_domains &= ~BIT(domain->id);
> + } else {
> + awake_rqst |= BIT(domain->id);
> + domain_wake(gt, domain);
> + }
> }
> ref_incr |= BIT(domain->id);
> }
[Severity: Medium]
What happens to domains in fw->delayed_domains across a PCIe FLR?
Even with commit "drm/xe/forcewake: flush delayed release at power and
teardown boundaries" flushing delayed domains in xe_gt_suspend() and
xe_gt_runtime_suspend(), xe_pci_reset_prepare() calls
xe_device_suspend(xe, false, true) with flr = true, which runs
xe_gt_flr_prepare() and skips xe_gt_suspend().
If a domain is in fw->delayed_domains when an FLR starts,
fw->delayed_release_work can fire during the reset and time out waiting
for a sleep ACK on a resetting device, or BIT(domain->id) can remain set
in fw->delayed_domains into xe_pci_reset_done() -> xe_gt_resume() so that
xe_force_wake_get() skips domain_wake() on a domain that hardware reset
to sleep.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261201230744.680448-1-zongyao.bai@intel.com?part=1
next prev parent reply other threads:[~2026-12-01 23:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 23:07 [RESEND PATCH v3 0/3] drm/xe/forcewake: add delayed release for engine-cycle queries Zongyao Bai
2026-12-01 23:07 ` [RESEND PATCH v3 1/3] drm/xe/forcewake: add delayed release with hysteresis Zongyao Bai
2026-12-01 23:30 ` sashiko-bot [this message]
2026-12-01 23:07 ` [RESEND PATCH v3 2/3] drm/xe/forcewake: flush delayed release at power and teardown boundaries Zongyao Bai
2026-12-01 23:24 ` sashiko-bot
2026-12-01 23:07 ` [RESEND PATCH v3 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-244390@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