lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1cebf2340386adf52bde31b05238199a201e9882.camel@rong.moe>
Date: Mon, 27 Oct 2025 01:11:04 +0800
From: Rong Zhang <i@...g.moe>
To: Derek John Clark <derekjohn.clark@...il.com>
Cc: Mark Pearson <mpearson-lenovo@...ebb.ca>, Armin Wolf <W_Armin@....de>, 
 Hans de Goede <hansg@...nel.org>, Ilpo Järvinen
 <ilpo.jarvinen@...ux.intel.com>,  Guenter Roeck <linux@...ck-us.net>,
 platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-hwmon@...r.kernel.org
Subject: Re: [PATCH 0/6] platform/x86: lenovo-wmi-{capdata,other}: Add
 HWMON for fan speed

Hi Derek,

On Sat, 2025-10-25 at 21:39 -0700, Derek John Clark wrote:
> On Sun, Oct 19, 2025 at 2:05 PM Rong Zhang <i@...g.moe> wrote:
> > 
> > Lenovo WMI Other Mode interface also supports querying or setting fan
> > speed RPM. This capability is decribed by LENOVO_CAPABILITY_DATA_00.
> > Besides, LENOVO_FAN_TEST_DATA provides reference data for self-test of
> > cooling fans, including minimum and maximum fan speed RPM.
> > 
> > This patchset turns lenovo-wmi-capdata01 into a unified driver (now
> > named lenovo-wmi-capdata) for LENOVO_CAPABILITY_DATA_{00,01} and
> > LENOVO_FAN_TEST_DATA; then adds HWMON support for lenovo-wmi-other:
> > 
> >  - fanX_enable: enable/disable the fan (tunable)
> >  - fanX_input: current RPM
> >  - fanX_max: maximum RPM
> >  - fanX_min: minimum RPM
> >  - fanX_target: target RPM (tunable)
> > 
> > This implementation doesn't require all capability data to be available,
> > and is capable to expose interfaces accordingly:
> > 
> >  - Having LENOVO_CAPABILITY_DATA_00: exposes fanX_{enable,input,target}
> >  - Having LENOVO_CAPABILITY_DATA_01: exposes firmware_attributes
> >  - Having LENOVO_FAN_TEST_DATA: exposes fanX_{max,min}
> > 
> > Rong Zhang (6):
> >   platform/x86: Rename lenovo-wmi-capdata01 to lenovo-wmi-capdata
> >   platform/x86: lenovo-wmi-{capdata,other}: Support multiple Capability
> >     Data
> >   platform/x86: lenovo-wmi-capdata: Add support for Capability Data 00
> >   platform/x86: lenovo-wmi-other: Add HWMON for fan speed RPM
> >   platform/x86: lenovo-wmi-capdata: Add support for Fan Test Data
> >   platform/x86: lenovo-wmi-other: Report min/max RPM and hide dummy fans
> > 
> >  .../wmi/devices/lenovo-wmi-other.rst          |  32 +
> >  drivers/platform/x86/lenovo/Kconfig           |   5 +-
> >  drivers/platform/x86/lenovo/Makefile          |   2 +-
> >  drivers/platform/x86/lenovo/wmi-capdata.c     | 545 ++++++++++++++++++
> >  drivers/platform/x86/lenovo/wmi-capdata.h     |  46 ++
> >  drivers/platform/x86/lenovo/wmi-capdata01.c   | 302 ----------
> >  drivers/platform/x86/lenovo/wmi-capdata01.h   |  25 -
> >  drivers/platform/x86/lenovo/wmi-other.c       | 422 +++++++++++++-
> >  8 files changed, 1028 insertions(+), 351 deletions(-)
> >  create mode 100644 drivers/platform/x86/lenovo/wmi-capdata.c
> >  create mode 100644 drivers/platform/x86/lenovo/wmi-capdata.h
> >  delete mode 100644 drivers/platform/x86/lenovo/wmi-capdata01.c
> >  delete mode 100644 drivers/platform/x86/lenovo/wmi-capdata01.h
> > 
> > 
> > base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
> > --
> > 2.51.0
> > 
> 
> The series' intention looks good overall. The composable methods for
> additional capdata interfaces is a welcome change. I have a few
> comments I'll add for a couple of the patches. My apologies for the
> slow review timeline, I've been on travel and wanted to test the
> changes before submitting a review.

Thanks for you review and testing! Hope you have/had a nice trip ;)

> For testing I'm using my Legion Go 2. It apparently doesn't have the
> FAN_TEST_DATA GUID, and the hwmon interface errors on all inputs
> despite being visible. I know for the Legion Go series they use a fan
> table with 10 auto_set points in the Other Method interface tied to
> the platform profile, but the documentation I have says the methods
> you're adding here should be available on all models, so that is a bit
> strange.

Yeah, that sounds weird.

As for the fan table on your device, did you mean
LENOVO_FAN_TABLE_DATA/LENOVO_FAN_METHOD? My device doesn't use a fan
table, the corresponding ACPI methods are dummy (see below).

My device is ThinkBook 14 G7+ ASP (forgot to mention when submitting,
sorry). I don't have any documentation and I finished the patchset
according to the MOF as well as the decompiled ASL code of its ACPI
tables. The information from the documentation (including those in your
following replies) is very useful, thanks for that!

As it's branded as ThinkBook, most GAMEZONE/WMI_OTHER interfaces on my
device may differ from Legion devices. To summerize:

- LENOVO_GAMEZONE_DATA: dummy ACPI method.
- LENOVO_GAMEZONE_CPU_OC_DATA: presents in MOF; missing ACPI method.
- LENOVO_GAMEZONE_GPU_OC_DATA: dummy ACPI method.
- LENOVO_CAPABILITY_DATA_00: works fine.
- LENOVO_CAPABILITY_DATA_01: dummy ACPI method, data still presents
  (\_SB.GZFD.CD01).
- LENOVO_FAN_TEST_DATA: works fine.
- LENOVO_FAN_TABLE_DATA: dummy ACPI method.
- LENOVO_FAN_METHOD: dummy ACPI method.
- LENOVO_OTHER_METHOD:
  * Despite missing LENOVO_CAPABILITY_DATA_01, SPPT/SPL/FPPT can still
    be get/set. There is also CHTC (FEATURE_ID=4, get/set) which I am
    not sure what it means.
  * FAN1/2: get method reads data from the EC; set method for FAN1
    updates the EC, for FAN2 is dummy (no-op, returns 0).

> dmesg output:
> [    3.995549] lenovo_wmi_cd 362A3AFE-3D96-4665-8530-96DAD5BB300E-13:
> registered LENOVO_CAPABILITY_DATA_00 with 33 items
> [    4.000266] lenovo_wmi_cd 7A8F5407-CB67-4D6E-B547-39B3BE018154-9:
> registered LENOVO_CAPABILITY_DATA_01 with 80 items
> [    4.005603] lenovo_wmi_other
> DC2A8805-3A8C-41BA-A6F7-092E0089CD3B-3: bound
> 362A3AFE-3D96-4665-8530-96DAD5BB300E-13 (ops lwmi_cd_component_ops
> [lenovo_wmi_capdata])
> [    4.005611] lenovo_wmi_other
> DC2A8805-3A8C-41BA-A6F7-092E0089CD3B-3: bound
> 7A8F5407-CB67-4D6E-B547-39B3BE018154-9 (ops lwmi_cd_component_ops
> [lenovo_wmi_capdata])
> [    4.005614] lenovo_wmi_other
> DC2A8805-3A8C-41BA-A6F7-092E0089CD3B-3: fan capdata unavailable
> 
> Testing results:
> (deck@...o2 hwmon5)$ ls
> device  fan1_enable  fan1_input  fan1_target  name  power  subsystem  uevent
> (deck@...o2 hwmon5)$ cat fan1_enable
> cat: fan1_enable: No data available
> (1)(deck@...o2 hwmon5)$ echo 1 | sudo tee fan1_enable
> [sudo] password for deck:
> 1
> tee: fan1_enable: Input/output error
> (1)(deck@...o2 hwmon5)$ echo 0 | sudo tee fan1_enable
> 0
> tee: fan1_enable: Input/output error
> (1)(deck@...o2 hwmon5)$ echo 3000 | sudo tee fan1_target
> 3000
> tee: fan1_target: Input/output error

-EIO was returned when the set method didn't return 1 (as long as
lwmi_dev_evaluate_int() didn't return this due to ACPI_FAILURE).
Despite the return value, did the fan speed change after writing?
Otherwise the method might be dummy and LENOVO_CAPABILITY_DATA_00
simply returned mistaken data :(

> (1)(deck@...o2 hwmon5)$ cat fan1_input
> cat: fan1_input: No such device or address

-ENXIO was returned by lwmi_dev_evaluate_int() as the return value was
not an integer. It's really weird. Could you check the type of the
return value? Some clues may also lie in the ASL code of the ACPI
method.

> Thanks,
> Derek

Thanks,
Rong

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ