From: "Poosa, Karthik" <karthik.poosa@intel.com>
To: <sashiko-reviews@lists.linux.dev>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v6 01/10] drm/xe/hwmon: Initialize fan-control backend and table cache
Date: Tue, 1 Dec 2026 10:40:10 +0530 [thread overview]
Message-ID: <8756fe93-d3e7-40d0-a930-be4daf6a9403@intel.com> (raw)
In-Reply-To: <sashiko-outbox-241897@kernel.org>
On 01-12-2026 00:34, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [Low] drm/xe/hwmon: overwritten return status in
> xe_hwmon_read_fan_control_info()
> - [Low] drm/xe/hwmon: commit message claims min PWM read removed in v5
> --
>
> commit 3b481ee0a99b1ba8da639e856d7c106898545563
> Author: Karthik Poosa <karthik.poosa@intel.com>
>
> drm/xe/hwmon: Initialize fan-control backend and table cache
>
> This commit initializes Xe hwmon fan-control support by caching the enabled
> fan bitmask from PCODE and reading the stock fan control tables for each
> enabled fan.
>
>> Initialize Xe hwmon fan-control support by detecting enabled fans,
>> reading stock fan control points and min PWM.
> [Severity: Low]
> This isn't a bug, but the commit message still mentions reading min PWM,
> which was dropped from the patch in v5.
I'll remove this.
>
>> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
>> index 171990602f537..72e176011ea7b 100644
>> --- a/drivers/gpu/drm/xe/xe_hwmon.c
>> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> [ ... ]
>> +static int xe_hwmon_read_fan_control_info(struct xe_hwmon *hwmon)
>> +{
>> + int point;
>> + int fan;
>> + int ret = 0;
>> +
>> + for (fan = 0; fan < FAN_MAX; fan++) {
>> + struct fan_control_point stock_fcp[MAX_FAN_CONTROL_POINTS];
>> + struct xe_hwmon_fan_info *fi = &hwmon->fi[fan];
>> + u32 stock_fcp_count = 0;
>> +
>> + if (!IS_FAN_ENABLED(hwmon, fan))
>> + continue;
>> +
>> + ret = xe_hwmon_pcode_read_fan_control(hwmon,
>> + FSC_READ_STOCK_FAN_CONTROL_POINTS,
>> + fan, &stock_fcp_count);
>> + if (ret || !stock_fcp_count) {
>> + xe_warn(hwmon->xe,
>> + "fan %d stock table unavailable, ret=%d, point count=%u\n",
>> + fan, ret, ret ? 0 : stock_fcp_count);
>> + continue;
>> + }
> [ ... ]
>> + memcpy(fi->fan_table[STOCK_FAN_TABLE].fcp, stock_fcp,
>> + stock_fcp_count * sizeof(stock_fcp[0]));
>> + fi->fan_table[STOCK_FAN_TABLE].point_count = stock_fcp_count;
>> + }
>> + return ret;
>> +}
> [Severity: Low]
> Does xe_hwmon_read_fan_control_info() return only the last PCODE read status
> instead of whether fan control tables are available?
>
> Because ret is reused across the loop and not set when stock_fcp_count is 0,
> an error on an earlier fan is overwritten if a higher-numbered fan succeeds,
> and returning 0 when all enabled fans report stock_fcp_count == 0 suppresses
> the "Fan control tables are not available" warning in
> xe_hwmon_get_preregistration_info(). Conversely, if fan 0 succeeds and a
> later fan fails (for example on single-fan DG2 cards where fan_enable_mask
> is hardcoded to GENMASK(1, 0)), the caller logs that fan control tables are
> not available even though fan 0's stock table was initialized.
We shall return failure if all the fans reads have failed.
If atleast 1 has returned success, we shall return pass.
next prev parent reply other threads:[~2026-12-01 5:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 18:50 [PATCH v6 00/10] drm/xe/hwmon: Add fan control support Karthik Poosa
2026-11-30 18:50 ` [PATCH v6 01/10] drm/xe/hwmon: Initialize fan-control backend and table cache Karthik Poosa
2026-11-30 19:04 ` sashiko-bot
2026-12-01 5:10 ` Poosa, Karthik [this message]
2026-11-30 18:50 ` [PATCH v6 02/10] drm/xe/hwmon: Expose fanN_max Karthik Poosa
2026-11-30 18:50 ` [PATCH v6 03/10] drm/xe/pcode: Add ordered write batch helper Karthik Poosa
2026-11-30 20:59 ` Rodrigo Vivi
2026-11-30 18:50 ` [PATCH v6 04/10] drm/xe/hwmon: Expose pwm[1-3] Karthik Poosa
2026-11-30 18:50 ` [PATCH v6 05/10] drm/xe/hwmon: Expose pwm[1-3]_enable Karthik Poosa
2026-11-30 18:50 ` [PATCH v6 06/10] drm/xe/hwmon: Enable fan curve control support Karthik Poosa
2026-11-30 21:00 ` Rodrigo Vivi
2026-11-30 18:50 ` [PATCH v6 07/10] drm/xe/hwmon: Restore fan user tables after resume Karthik Poosa
2026-11-30 21:03 ` Rodrigo Vivi
2026-12-01 4:55 ` Nilawar, Badal
2026-12-01 5:13 ` Poosa, Karthik
2026-11-30 18:50 ` [PATCH v6 08/10] drm/xe/hwmon: Refresh fan data after late binding Karthik Poosa
2026-12-01 5:32 ` Nilawar, Badal
2026-11-30 18:50 ` [PATCH v6 09/10] drm/xe: Expose tjmax_fan_control_enable device sysfs Karthik Poosa
2026-11-30 18:50 ` [PATCH v6 10/10] drm/xe/hwmon: Add kernel-doc for fan control Karthik Poosa
2026-11-30 21:04 ` Rodrigo Vivi
2026-11-30 20:52 ` ✓ CI.KUnit: success for drm/xe/hwmon: Add fan control support (rev3) Patchwork
2026-11-30 21:32 ` ✓ Xe.CI.BAT: " 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=8756fe93-d3e7-40d0-a930-be4daf6a9403@intel.com \
--to=karthik.poosa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox