From: sashiko-bot@kernel.org
To: "Karthik Poosa" <karthik.poosa@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/hwmon: Expose powerX_cap_max
Date: Thu, 19 Nov 2026 10:47:50 +0000 [thread overview]
Message-ID: <sashiko-outbox-222985@kernel.org> (raw)
In-Reply-To: <20261119104029.3066660-1-karthik.poosa@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/hwmon: power limit clamped to 0 in
xe_hwmon_power_max_write() [1]
--
commit 26f9457c44502cd969a84eaf5b2ee961f51b7a3e
Author: Karthik Poosa <karthik.poosa@intel.com>
drm/xe/hwmon: Expose powerX_cap_max
This commit adds a read-only power<i>_cap_max sysfs attribute on platforms
with mailbox power limits to report the default PL2 (burst) power limit
set by firmware at boot.
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index defe8aaca7c11..8e0d295aabc88 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
[ ... ]
> @@ -1423,6 +1424,8 @@ xe_hwmon_power_is_visible(struct xe_hwmon *hwmon, u32 attr, int channel)
> struct xe_mmio *mmio = xe_root_tile_mmio(hwmon->xe);
>
> switch (attr) {
> + case hwmon_power_cap_max:
> + return hwmon->pl2_on_boot[channel] ? 0444 : 0;
[Severity: High]
This problem wasn't introduced by this patch, but can a pcode read failure
during probe cause xe_hwmon_power_max_write() to clamp user power limits
to 0 [1]?
If reading the initial power limits in xe_hwmon_get_preregistration_info()
fails, pl1_on_boot[] and pl2_on_boot[] remain zero while hwmon registration
still proceeds:
drivers/gpu/drm/xe/xe_hwmon.c:xe_hwmon_get_preregistration_info() {
if (hwmon->xe->info.has_mbx_power_limits) {
if (xe_hwmon_pcode_read_power_limit(hwmon, PL1_HWMON_ATTR, CHANNEL_CARD,
&hwmon->pl1_on_boot[CHANNEL_CARD]) |
...
xe_hwmon_pcode_read_power_limit(hwmon, PL2_HWMON_ATTR, CHANNEL_PKG,
&hwmon->pl2_on_boot[CHANNEL_PKG])) {
drm_warn(&hwmon->xe->drm,
"Failed to read power limits, check GPU firmware !\n");
} else {
}
If the subsequent pcode read in xe_hwmon_power_is_visible() succeeds, the
writable powerX_max and powerX_cap attributes are exposed, and any value
userspace writes is clamped to the zeroed pl1_on_boot[] or pl2_on_boot[]
entry in xe_hwmon_power_max_write(), programming a 0W power limit into
firmware and severely throttling the GPU.
[1] https://sashiko.dev/#/bug/linux-9f11cfb5-f9c5-490e-879e-791ecaae33e5
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119104029.3066660-1-karthik.poosa@intel.com?part=1
next prev parent reply other threads:[~2026-11-19 10:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 10:40 [PATCH] drm/xe/hwmon: Expose powerX_cap_max Karthik Poosa
2026-11-19 10:47 ` sashiko-bot [this message]
2026-11-19 15:24 ` Poosa, Karthik
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-222985@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox