From: "Purkait, Soham" <soham.purkait@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: <rodrigo.vivi@intel.com>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>, <raag.jadav@intel.com>,
<riana.tauro@intel.com>, <sk.anirban@intel.com>,
<mallesh.koujalagi@intel.com>,
<ravi.kishore.koppuravuri@intel.com>
Subject: Re: [PATCH v3 7/9] drm/xe/hwmon: Add kernel-doc for fan control
Date: Fri, 30 Oct 2026 19:12:56 +0530 [thread overview]
Message-ID: <b186efb7-fe31-40f5-94f2-7517d147adc8@intel.com> (raw)
In-Reply-To: <20261015190751.1268916-8-karthik.poosa@intel.com>
Hi Karthik,
On 16-10-2026 00:37, Karthik Poosa wrote:
> Add kernel-doc for xe hwmon fan control and describe the fan control
> model built around firmware stock tables and driver-managed user tables.
>
> Document the exposed sysfs files for fan speed, maximum speed, pwm
> control, pwm mode selection, and per-point fan curve temperature/PWM
> programming.
>
> This makes the hwmon fan control userspace interface easier to discover
> and understand.
>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> Assisted-by: LLM
> ---
> drivers/gpu/drm/xe/xe_hwmon.c | 43 +++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index de2adb56d15b..aa3c921407b5 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -139,6 +139,49 @@ struct xe_hwmon_energy_info {
> long accum_energy;
> };
>
> +/**
> + * DOC: Xe fan control
> + *
> + * Xe fan control is exposed through the hwmon pwm and fan interfaces when the
> + * platform advertises PCODE-backed fan management support.
> + *
> + * The implementation tracks two fan tables per fan:
> + *
> + * - A stock table read from firmware through PCODE.
> + * - A user table cached in the driver and programmed back through PCODE.
> + *
> + * The pwmN_enable sysfs mode selects how those tables are used:
> + *
> + * - ``XE_FAN_PWM_AUTO_STOCK_TABLE`` restores automatic control using the stock
> + * firmware table.
> + * - ``XE_FAN_PWM_MANUAL_USER_TABLE`` enables the user table for manual control.
> + * - ``XE_FAN_PWM_FULL_SPEED`` reuses the user table path but programs every
> + * point to 100 percent duty cycle as a full-speed override.
> + *
> + * The fan-control sysfs files are:
> + *
> + * - ``fanN_input`` reports the measured fan speed in RPM.
> + * - ``fanN_max`` reports the maximum supported fan speed in RPM.
> + * - ``pwmN`` reads or sets the manual PWM duty cycle in the hwmon 0..255
> + * range. Manual writes are accepted only while ``pwmN_enable`` is set to
> + * ``XE_FAN_PWM_MANUAL_USER_TABLE``.
> + * - ``pwmN_enable`` selects stock automatic mode, manual user-table mode, or
> + * full-speed override.
Should the ABI values be noted (0 = full speed, 1 = manual, 2 =
automatic), since users write the number?
> + * - ``pwmN_auto_pointM_temp`` exposes the temperature threshold for user-table
> + * point ``M`` in millidegrees Celsius.
> + * - ``pwmN_auto_pointM_pwm`` exposes the PWM value for user-table point ``M``
> + * in the hwmon 0..255 range.
Is it required to mention that point writes also require pwmN_enable =
manual, else they return invalid?
> + *
> + * Writes to pwmN_auto_pointM_temp and pwmN_auto_pointM_pwm update the cached
> + * user table entries. The driver commits the full user table once the last
> + * point has both temperature and PWM values, which keeps intermediate sysfs
> + * writes from pushing partially updated curves to firmware.
Could the (0, 0) end-marker be documented, since writing such a point
terminates a shorter curve rather than requiring all points?
and also at least 2 points, non-decreasing temp and pwm, else invalid.
Regards,
Soham
> + *
> + * Writes to pwmN provide a constant manual duty cycle by rewriting every point
> + * in the active user table to the same PWM value, clamped against the minimum
> + * duty cycle reported by firmware for that fan.
> + */
> +
> enum xe_fan_pwm_enable_mode {
> /** @XE_FAN_PWM_FULL_SPEED: force all user table points to full speed */
> XE_FAN_PWM_FULL_SPEED = 0,
next prev parent reply other threads:[~2026-10-30 13:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 19:07 [PATCH v3 0/9] Add fan control support Karthik Poosa
2026-10-15 19:07 ` [PATCH v3 1/9] drm/xe/hwmon: initialize fan-control backend and table cache Karthik Poosa
2026-10-28 18:46 ` Purkait, Soham
2026-10-29 11:34 ` Poosa, Karthik
2026-10-29 12:02 ` Purkait, Soham
2026-10-29 12:04 ` Purkait, Soham
2026-10-15 19:07 ` [PATCH v3 2/9] drm/xe/hwmon: expose fanN_max Karthik Poosa
2026-10-29 4:35 ` Purkait, Soham
2026-10-29 11:39 ` Poosa, Karthik
2026-10-15 19:07 ` [PATCH v3 3/9] drm/xe/pcode: add ordered write batch helper Karthik Poosa
2026-10-29 5:45 ` Purkait, Soham
2026-10-29 11:40 ` Poosa, Karthik
2026-10-15 19:07 ` [PATCH v3 4/9] drm/xe/hwmon: expose pwm[1-3] Karthik Poosa
2026-10-29 11:31 ` Purkait, Soham
2026-10-15 19:07 ` [PATCH v3 5/9] drm/xe/hwmon: expose pwm[1-3]_enable Karthik Poosa
2026-10-29 18:33 ` Purkait, Soham
2026-10-15 19:07 ` [PATCH v3 6/9] drm/xe/hwmon: Enable fan curve control support Karthik Poosa
2026-10-30 6:33 ` Purkait, Soham
2026-10-15 19:07 ` [PATCH v3 7/9] drm/xe/hwmon: Add kernel-doc for fan control Karthik Poosa
2026-10-30 13:42 ` Purkait, Soham [this message]
2026-10-15 19:07 ` [PATCH v3 8/9] drm/xe/hwmon: preserve fan user table across suspend resume Karthik Poosa
2026-10-15 19:07 ` [PATCH v3 9/9] drm/xe/hwmon: Update fan info after late binding Karthik Poosa
2026-10-15 19:46 ` ✗ CI.checkpatch: warning for Add fan control support Patchwork
2026-10-15 19:48 ` ✓ CI.KUnit: success " Patchwork
2026-10-15 21:01 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-10-16 7:56 ` ✗ Xe.CI.FULL: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-10-15 19:01 [PATCH v3 0/9] " Karthik Poosa
2026-10-15 19:01 ` [PATCH v3 7/9] drm/xe/hwmon: Add kernel-doc for fan control Karthik Poosa
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=b186efb7-fe31-40f5-94f2-7517d147adc8@intel.com \
--to=soham.purkait@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--cc=mallesh.koujalagi@intel.com \
--cc=raag.jadav@intel.com \
--cc=ravi.kishore.koppuravuri@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=sk.anirban@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