From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: <sashiko-reviews@lists.linux.dev>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/xe: Inspect all forcewake bits for runtime idleness
Date: Wed, 9 Sep 2026 17:47:01 -0700 [thread overview]
Message-ID: <f157947e-ffda-4d4b-9048-6b8584b85e63@intel.com> (raw)
In-Reply-To: <20260909015604.CF1D91F00A3A@smtp.kernel.org>
On 9/8/2026 6:56 PM, sashiko-bot@kernel.org wrote:
> 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?
yes, will change to xe_gt_dbg 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?
Might be possibly required, will evaluate.
Thanks,
Vinay.
>
>> return 0;
>> }
>>
next prev parent reply other threads:[~2026-09-10 0:47 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 ` [PATCH 1/2] " sashiko-bot
2026-09-10 0:47 ` Belgaumkar, Vinay [this message]
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=f157947e-ffda-4d4b-9048-6b8584b85e63@intel.com \
--to=vinay.belgaumkar@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.