Re: [PATCH v10] hwmon: (yogafan) Add support for Lenovo Yoga/Legion fan monitoring

Guenter Roeck
2026-03-27T18:01:37Z

Hi Sergio,

On 3/26/26 18:29, Sergio Melas wrote:
> To address low-resolution sampling in the Lenovo EC firmware, the
> driver implements a Rate-Limited Lag (RLLag) filter using a passive
> discrete-time first-order model. This ensures physical consistency
> of the RPM signal regardless of userspace polling rates.
>
> Concerning youd doubt:
> Sorry, you lost me a bit. Isn't that already implemented in v8 ?
>
> V8 had the logic, but V9 adds the extensive database and documentation
> (see yogafan.rst) to guarantee all ACPI paths and 8/16-bit multipliers
> are correctly mapped.
>
> Please disregard the previous v9 submission. It was incorrectly formatted
> as an incremental diff; this version (v9/v10) is a complete standalone
> patch for clean application.
> Apologies for the noise.
>

I didn't realize, but the above is really not an appropriate patch description.
Please follow Documentation/process/submitting-patches.rst for a more
appropriate description.

Also, I noticed that you send new versions of your patch as reply to previous
versions. Please don't do that. Again, please see the guidelines for submitting
patches.

Additional comments below.

> Signed-off-by: Sergio Melas <sergiomelas@gmail.com>
>
> ---
[...]
> +===============================================================================================
> +LENOVO FAN CONTROLLER: MASTER REFERENCE DATABASE (2026)
> +===============================================================================================
> +
> +MODEL (DMI PN) | FAMILY / SERIES | EC OFFSET | FULL ACPI OBJECT PATH | WIDTH | MULTiplier
> +-----------------------------------------------------------------------------------------------

I think 0-day complains because the length of the underline string does not match
the length of the description.

> +82N7 | Yoga 14cACN | 0x06 | \_SB.PCI0.LPC0.EC0.FANS | 8-bit | 100
> +80V2 / 81C3 | Yoga 710/720 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100
> +83E2 / 83DN | Yoga Pro 7/9 | 0xFE | \_SB.PCI0.LPC0.EC0.FANS | 8-bit | 100
> +82A2 / 82A3 | Yoga Slim 7 | 0x06 | \_SB.PCI0.LPC0.EC0.FANS | 8-bit | 100
> +81YM / 82FG | IdeaPad 5 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100
> +82JW / 82JU | Legion 5 (AMD) | 0xFE/0xFF | \_SB.PCI0.LPC0.EC0.FANS (Fan1) | 16-bit | 1
> +82JW / 82JU | Legion 5 (AMD) | 0xFE/0xFF | \_SB.PCI0.LPC0.EC0.FA2S (Fan2) | 16-bit | 1
> +82WQ | Legion 7i (Int) | 0xFE/0xFF | \_SB.PCI0.LPC0.EC0.FANS (Fan1) | 16-bit | 1
> +82WQ | Legion 7i (Int) | 0xFE/0xFF | \_SB.PCI0.LPC0.EC0.FA2S (Fan2) | 16-bit | 1
> +82XV / 83DV | LOQ 15/16 | 0xFE/0xFF | \_SB.PCI0.LPC0.EC0.FANS /FA2S | 16-bit | 1
> +83AK | ThinkBook G6 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100
> +81X1 | Flex 5 | 0x06 | \_SB.PCI0.LPC0.EC0.FAN0 | 8-bit | 100
> +*Legacy* | Pre-2020 Models | 0x06 | \_SB.PCI0.LPC.EC.FAN0 | 8-bit | 100

Since this is known based on the model,

[ ...]
> +static int yoga_fan_probe(struct platform_device *pdev)
> +{
> + const struct dmi_system_id *dmi_id;
> + const struct yogafan_config *cfg;
> + struct yoga_fan_data *data;
> + struct device *hwmon_dev;
> + acpi_handle handle;
> + int i;
> + static const char * const fan_paths[] = {
> + "\\_SB.PCI0.LPC0.EC0.FANS", /* Primary Fan (Yoga) */
> + "\\_SB.PCI0.LPC0.EC0.FA2S", /* Secondary Fan (Legion / LOQ) */
> + "\\_SB.PCI0.LPC0.EC0.FAN0", /* IdeaPad / Slim / Flex */
> + "\\_SB.PCI0.LPC.EC.FAN0", /* Legacy (pre-2020 models) */
> + "\\_SB.PCI0.LPC0.EC.FAN0", /* Alternate (Certain Slim/Flex) */
> + };

Is this table even necessary ? It should be possible to identify the supported ACPI
object path(s) from the DMI table entry.

Thanks,
Guenter