From: sashiko-bot@kernel.org
To: "Vinay Belgaumkar" <vinay.belgaumkar@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/xe: Inspect all forcewake bits for runtime idleness
Date: Wed, 09 Sep 2026 01:56:04 +0000 [thread overview]
Message-ID: <20260909015604.CF1D91F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909013712.1962521-1-vinay.belgaumkar@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Returning -EAGAIN from `xe_pci_runtime_idle` aborts the runtime PM idle transition but fails to schedule a retry, permanently preventing runtime suspend.
- [Medium] Using `xe_gt_info` in a runtime PM path will cause severe log spam when forcewake is held.
--
commit 987ddc78bc72644b422f8d130f4407129128a641
Author: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
drm/xe: Inspect all forcewake bits for runtime idleness
This commit updates the runtime idleness check to inspect all forcewake
bits across all domains. If any bit is set, it returns -EAGAIN to skip
the suspend operation.
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_force_wake.c
[ ... ]
> +bool xe_force_wake_any_bit_set(struct xe_force_wake *fw)
> +{
> + struct xe_gt *gt = fw->gt;
> + struct xe_force_wake_domain *domain;
> + unsigned int tmp;
> + u32 val;
> +
> + for_each_fw_domain(domain, fw, tmp) {
> + val = xe_mmio_read32(>->mmio, domain->reg_ctl);
> + if (val & 0xFFFF) {
> + xe_gt_info(gt, "FW bit set in domain: %d, val: 0x%x",
> + domain->id, val);
[Severity: Medium]
Will this cause severe log spam in high-frequency runtime PM paths?
Forcewake can be legitimately held for long periods (for example, by
userspace profiling tools, IGT tests, or debugfs readers). Every time the
driver drops its PM reference and triggers a runtime idle check, this
unconditional info message will print if the external agent is still holding
forcewake.
Should this be a debug-level log (xe_gt_dbg) or rate-limited instead?
> + return true;
> + }
> + }
> +
> + return false;
> +}
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
[ ... ]
> @@ -1437,9 +1438,14 @@ static int xe_pci_runtime_idle(struct device *dev)
> {
> struct pci_dev *pdev = to_pci_dev(dev);
> struct xe_device *xe = pdev_to_xe_device(pdev);
> + struct xe_gt *gt;
> + u8 id;
>
> xe_pm_d3cold_allowed_toggle(xe);
>
> + for_each_gt(gt, xe, id)
> + if (xe_force_wake_any_bit_set(gt_to_fw(gt)))
> + return -EAGAIN;
[Severity: High]
Will returning -EAGAIN here permanently prevent runtime suspend?
When the PM core's rpm_idle() function receives a non-zero return value, it
aborts the idle transition and bypasses the subsequent call to rpm_suspend().
Returning an error code does not automatically instruct the PM core to poll
or reschedule an autosuspend.
If a forcewake bit happens to be set at the moment the PM usage count drops
to 0, it seems the device will remain stranded in the active (D0) state
indefinitely.
Should this explicitly schedule a retry, perhaps by calling
pm_runtime_mark_last_busy() and pm_runtime_autosuspend() before returning?
> return 0;
> }
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909013712.1962521-1-vinay.belgaumkar@intel.com?part=1
next prev parent reply other threads:[~2026-09-09 1:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 1:37 [PATCH 1/2] drm/xe: Inspect all forcewake bits for runtime idleness Vinay Belgaumkar
2026-09-09 1:37 ` [PATCH 2/2] drm/xe: Poll GT for C6 before D3 Vinay Belgaumkar
2026-09-09 1:53 ` sashiko-bot
2026-09-10 0:48 ` Belgaumkar, Vinay
2026-09-09 1:50 ` ✓ CI.KUnit: success for series starting with [1/2] drm/xe: Inspect all forcewake bits for runtime idleness Patchwork
2026-09-09 1:56 ` sashiko-bot [this message]
2026-09-10 0:47 ` [PATCH 1/2] " Belgaumkar, Vinay
2026-09-09 2:26 ` ✓ Xe.CI.BAT: success for series starting with [1/2] " Patchwork
2026-09-09 10:17 ` ✗ 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=20260909015604.CF1D91F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vinay.belgaumkar@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