All of lore.kernel.org
 help / color / mirror / Atom feed
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>
Subject: Re: [PATCH v2 7/9] drm/xe/hwmon: Add kernel-doc for fan control
Date: Fri, 4 Sep 2026 09:32:39 +0530	[thread overview]
Message-ID: <5082034f-13f5-419e-98d0-a558a6f8d111@intel.com> (raw)
In-Reply-To: <20260717041757.2759084-8-karthik.poosa@intel.com>

HI Karthik,

On 17-07-2026 09:47, 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: Codex:gpt-5-4
> ---
>   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 a3ed139ad446..770f07fb6511 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -123,6 +123,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``.
Could you please double check this claim ? Seems like in 
XE_FAN_PWM_FULL_SPEED mode of pwmN_enable also accepts the manual write.
> + * - ``pwmN_enable`` selects stock automatic mode, manual user-table mode, or
> + *   full-speed override.
> + * - ``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 always user-table point ? What happens when mode is set to 
XE_FAN_PWM_AUTO_STOCK_TABLE ?

Thanks,
Soham

> + *
> + * 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.
> + *
> + * 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,

  reply	other threads:[~2026-09-04  4:02 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  4:17 [PATCH v2 0/9] Add fan control support Karthik Poosa
2026-07-17  4:16 ` ✓ CI.KUnit: success for Add fan control support (rev2) Patchwork
2026-07-17  4:17 ` [PATCH v2 1/9] drm/xe/pcode: Introduce xe_pcode_read_timeout() API Karthik Poosa
2026-07-17  4:17 ` [PATCH v2 2/9] drm/xe/hwmon: initialize fan-control backend and table cache Karthik Poosa
2026-08-10  6:03   ` Nilawar, Badal
2026-08-25 16:10     ` Poosa, Karthik
2026-08-11 13:11   ` Nilawar, Badal
2026-08-17 17:01     ` Poosa, Karthik
2026-08-25 16:14     ` Poosa, Karthik
2026-07-17  4:17 ` [PATCH v2 3/9] drm/xe/hwmon: expose fanN_max Karthik Poosa
2026-07-23  5:34   ` Purkait, Soham
2026-07-17  4:17 ` [PATCH v2 4/9] drm/xe/hwmon: expose pwm[1-3] Karthik Poosa
2026-07-24  7:02   ` Purkait, Soham
2026-08-11 13:58     ` Poosa, Karthik
2026-09-01  6:06   ` Purkait, Soham
2026-09-02  7:14     ` Poosa, Karthik
2026-09-03  6:22   ` Purkait, Soham
2026-07-17  4:17 ` [PATCH v2 5/9] drm/xe/hwmon: expose pwm[1-3]_enable Karthik Poosa
2026-09-02  5:57   ` Purkait, Soham
2026-07-17  4:17 ` [PATCH v2 6/9] drm/xe/hwmon: Enable fan curve control support Karthik Poosa
2026-07-22 18:16   ` Purkait, Soham
2026-08-27 12:07     ` Poosa, Karthik
2026-09-03 17:13       ` Purkait, Soham
2026-09-02  6:35   ` Purkait, Soham
2026-09-02  7:36     ` Poosa, Karthik
2026-09-03 17:36   ` Purkait, Soham
2026-07-17  4:17 ` [PATCH v2 7/9] drm/xe/hwmon: Add kernel-doc for fan control Karthik Poosa
2026-09-04  4:02   ` Purkait, Soham [this message]
2026-09-04 14:35     ` Poosa, Karthik
2026-07-17  4:17 ` [PATCH v2 8/9] drm/xe/hwmon: preserve fan user table across suspend resume Karthik Poosa
2026-08-10  5:53   ` Nilawar, Badal
2026-08-27 10:27     ` Poosa, Karthik
2026-07-17  4:17 ` [PATCH v2 9/9] drm/xe/hwmon: Update fan info after late binding Karthik Poosa
2026-07-20  6:20   ` Purkait, Soham
2026-08-27 10:36     ` Poosa, Karthik
2026-07-17  5:00 ` ✓ Xe.CI.BAT: success for Add fan control support (rev2) Patchwork
2026-07-17  8:18 ` ✗ 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=5082034f-13f5-419e-98d0-a558a6f8d111@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=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 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.