summaryrefslogtreecommitdiff
path: root/scripts/const_structs.checkpatch
diff options
context:
space:
mode:
authorKrishna Chomal <krishna.chomal108@gmail.com>2026-10-17 18:54:21 +0530
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-10-20 23:51:46 +0300
commite931e54edb0fae350007c4054cfbf095cc316bd8 (patch)
tree579fff4cf15fbbace8e35a159e38981d65d2e2e9 /scripts/const_structs.checkpatch
parent9962770049c715fc30a7b3274d8f245167c0a410 (diff)
platform/x86: hp-wmi: Disable hwmon attributes when no fans are usable
Currently, hp_wmi_hwmon_is_visible() checks whether fan RPM queries succeed before exposing fan1_input and fan2_input, but pwm1_enable remains visible always, even when fan support is unavailable. On some devices, such as certain Omnibook models, the firmware does not provide functional WMI fan methods. Exposing pwm1_enable on these devices can mislead userspace and cause fan mode changes to fail. Additionally, some firmware implementations provide stub methods that return an all-zero buffer instead of an error. In this case, hp_wmi_get_active_fan_speed() and hp_wmi_get_fan_speed() can report 0 RPM even when the fan is physically spinning. Use the result of fan count query (fetched from firmware once in hp_wmi_setup_fan_settings(), and cached in hwmon private data) to determine whether fan related attributes should be exposed. The fan count query can have the following outcomes: * Negative: The WMI query failed. Other fan-related queries are also expected to fail, so disable fan support. * Zero (stub firmware): The methods return zero-filled responses without providing functional fan support, so disable fan support. * Zero (genuine firmware): No fans are exposed through WMI, so disable fan support. * Positive (1 or 2): Firmware reports one or more fans, so allow fan support. Per-channel RPM queries continue to determine which individual fan input attributes are exposed. When fan support is unavailable, hide the fan and PWM attributes and skip applying the initial fan settings. Tested on: HP OmniBook 5 Laptop 16-ag1xxx (board: 8DF4) Tested-by: Lorenzo Collevecchio <lorenzocollevecchio17@gmail.com> Reported-by: Lorenzo Collevecchio <lorenzocollevecchio17@gmail.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222138 Signed-off-by: Krishna Chomal <krishna.chomal108@gmail.com> Link: https://patch.msgid.link/20261017132421.279522-1-krishna.chomal108@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions