On 12/12/24 3:45 PM, Julien ROBIN wrote:
Hello there,
Using intended WMI drivers and associated sysfs through `pwm1_enable`
and `pwm1` virtual files generally allows manual setting of fan speed on
laptops, which can be useful to set maximum speed when running rude CPU
and GPU tasks for example (to avoid reaching crazy temperatures).
I have a new machine (HP 16-s1034nf) on which (even with latest mainline
kernel 6.13-rc2) this pwm fan control sysfs interface is failing, and
fan speed reported values are stuck to zero (even when they are
blowing), through hp-wpi driver.
Just to be sure, I checked using "HP Omen Gaming Hub" application in
Windows that the hardware is actually capable of fan speed reading and
setting (the answer is yes).
In details:
- `/sys/devices/platform/hp-wmi/hwmon/hwmon6/pwm1_enable` writing
isn't applied (when writing "0", value is kept to "2" and writing "1"
says write error: Invalid argument)
- `/sys/devices/platform/hp-wmi/hwmon/hwmon6/pwm1` is missing
- `/sys/devices/platform/hp-wmi/hwmon/hwmon6/fan1_input` is always
stuck to 0 (even when fans are running)
- `/sys/devices/platform/hp-wmi/hwmon/hwmon6/fan2_input` is always
stuck to 0 too (this computer actually has 2 fans)
The interesting part of the dmesg output is the following:
[...]
input: HP WMI hotkeys as /devices/virtual/input/input15
ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PEP.DETY],
AE_NOT_FOUND (20240322/psargs-332)
ACPI Error: Aborting method \_SB.WMID.GTPS due to previous error
(AE_NOT_FOUND) (20240322/psparse-529)
ACPI Error: Aborting method \_SB.WMID.RDCF due to previous error
(AE_NOT_FOUND) (20240322/psparse-529)
ACPI Error: Aborting method \_SB.WMID.WHCM due to previous error
(AE_NOT_FOUND) (20240322/psparse-529)
ACPI Error: Aborting method \_SB.WMID.WMAA due to previous error
(AE_NOT_FOUND) (20240322/psparse-529)
[...]
All of the previous dmesg messages are disappearing when booting with
`module_blacklist=hp_wmi` into the Kernel command line. In place of
them, we got a single line:
[..]
Module hp_wmi is blacklisted
[..]
So I understand these errors mentioning ACPI are caused by what the
hp_wmi driver is doing (or trying to).
In order to be sure this isn't an ACPI Firmware bug from the laptop's
ACPI tables, I used Firmware Test Suite on "DSDT" as explained into
https://wiki.ubuntu.com/Kernel/Reference/WMI
It turns out imperfections found by FWTS aren't related to the HP WMI
interfaces GUID. Anyway I'm still providing all of the related files and
results in case someone needs them.
Unfortunately, going further alone is a little bit outside of my skills,
but I keep available for any questions and tests.
As it's my first bug report into this mailing list, I hope I didn't make
too much mistakes! Sincerely sorry in advance if I did.
Best regards,
Julien ROBIN
Notes:
- Using Debian 13/Trixie (testing)
- Problem still exists on latest 6.13-rc2 "pure" kernel with no DKMS
loaded driver
I placed all of the required files (dmidecode, dmesg, kernel config, and
ACPI tables related stuff) into the following link:
- https://pix-server-sorel.luoss.fr/Manual/Linux/HP-WMI/Bug-
Report-2024-12-12/
As an update on this subject, I eventually went further, I obtained much
more comprehensive information and did some successful tests.
I'm sharing it there, in case some people are looking at this issue in
the future. If not, I may be able to work on a reliable update patch
later, to implement new behavior on correctly identified new laptops
models without altering behavior with the previous ones.
- 1st change: User defined settings (thermal profiles and fan speeds)
aren't used unless a "Fan Count get query" = 0x10 query using HP_WMI
command HPWMI_GM = 0x20008, is played before. This should also be used
as a keep-alive to maintain the computer in the user defined state,
instead of having it returning default generic state after a 120 seconds
timeout.
- 2nd change: Disabling Max fan speed by writing back "0" with
HPWMI_FAN_SPEED_MAX_SET_QUERY = 0x27 is not enough: it should be
disabled using "Fan Speed set query" = 0x2E query using HP_WMI command
HPWMI_GM = 0x20008, and providing 0x00 values (2 bytes).
- 3rd change: Reading the fan speed with 0x11 query doesn't work
anymore, instead, 0x2D query may be used to retrieve actual/measured fan
speed (and the reading of the returned value is different).
- 4th change: The performance modes / thermal profiles, which should
be applied using HPWMI_SET_PERFORMANCE_MODE = 0x1A queries, are using
only 2 values: 0x00 for ECO/Balanced modes, and 0x01 for Performance. It
only changes the cTDP values of the CPU. But the HP provided app for
Windows also performs other new queries, including GPU related thermal
settings.
- 5th change: No EC register seems to allow retrieving the current
performance mode, so the ec_read(HP_OMEN_EC_THERMAL_PROFILE_OFFSET,
&data) thing shouldn't be used anymore.
All the details:
https://pix-server-sorel.luoss.fr/Manual/Linux/HP-WMI/Bug-Report-2024-12-12/HP-WMI-retro-engineering-2024-12-17.txt
As an example of quick/dirty successful tests with the fans:
https://pix-server-sorel.luoss.fr/Manual/Linux/HP-WMI/Bug-Report-2024-12-12/hp-wmi-original-6.12.4.c
https://pix-server-sorel.luoss.fr/Manual/Linux/HP-WMI/Bug-Report-2024-12-12/hp-wmi-FAN-SET+GET-success.c
Best regards,
Julien ROBIN
PS:
About the dmesg "AE_NOT_FOUND" errors I mentioned into my original
message, it happens when legacy HPWMI_THERMAL_PROFILE_QUERY = 0x4C is
being used (for Omen/Victus laptops it doesn't work anymore) instead of
the HPWMI_SET_PERFORMANCE_MODE = 0x1A query.
And about the missing pwm1 file / impossibility to write "1" into
pwm1_enable file, this is just because as of today, the driver isn't
providing manual fan speed control other than Max or Auto (so this was
normal).