[PATCH] platform/x86: hp-wmi: Hide bogus fan RPM on HP ENVY x360 13-bd0xxx

Bani Brata posted 1 patch 4 days, 5 hours ago
There is a newer version of this series
drivers/platform/x86/hp/hp-wmi.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
[PATCH] platform/x86: hp-wmi: Hide bogus fan RPM on HP ENVY x360 13-bd0xxx
Posted by Bani Brata 4 days, 5 hours ago
On the HP ENVY x360 Convertible 13-bd0xxx (board 8824), the WMI
interfaces for reading fan speed (HPWMI_FAN_SPEED_GET_QUERY) return
zero-filled buffers regardless of the actual fan speed.

This results in the hp_wmi driver exposing `fan1_input` and `fan2_input`
nodes through hwmon that permanently report "0 RPM", which is misleading
and interferes with userspace sensor monitoring tools.

Add a DMI quirk to disable exposing the hwmon fan nodes on this specific
board.

Signed-off-by: Bani Brata <banibrata2007@gmail.com>
---
 drivers/platform/x86/hp/hp-wmi.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index XXXXXXX..XXXXXXX 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -192,6 +192,18 @@ static const struct dmi_system_id hp_wmi_rfkill_dmi_table[] __initconst = {
 };
 
 static bool is_victus_s_board;
+static bool is_envy_x360_8824_board;
+
+static const struct dmi_system_id hp_envy_x360_8824_boards[] __initconst = {
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 13-bd0xxx"),
+			DMI_MATCH(DMI_BOARD_NAME, "8824"),
+		},
+	},
+	{},
+};
 
 enum hp_wmi_radio {
 	HPWMI_WIFI	= 0x0,
@@ -2166,6 +2178,8 @@ static umode_t hp_wmi_hwmon_is_visible(const void *data,
 	case hwmon_pwm:
 		return 0644;
 	case hwmon_fan:
+		if (is_envy_x360_8824_board)
+			return 0;
 		if (is_victus_s_thermal_profile()) {
 			if (hp_wmi_get_fan_speed_victus_s(channel) >= 0)
 				return 0444;
@@ -2188,6 +2202,8 @@ static int hp_wmi_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
 
 	switch (type) {
 	case hwmon_fan:
+		if (is_envy_x360_8824_board)
+			return -EOPNOTSUPP;
 		if (is_victus_s_thermal_profile())
 			ret = hp_wmi_get_fan_speed_victus_s(channel);
 		else
@@ -2281,6 +2297,8 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
 {
 	const struct dmi_system_id *id;
 
+	is_envy_x360_8824_board = dmi_first_match(hp_envy_x360_8824_boards);
+
 	/*
 	 * Currently only victus_s devices use the
 	 * active_thermal_profile_params
-- 
2.48.1