Re: [PATCH 0/9] platform/x86: lenovo-wmi-{other,capdata,helpers}: Improve robustness on buggy firmware
From: Navon John Lukose
Date: Sat Sep 26 2026 - 17:04:33 EST
Tested on a Yoga Pro 7 14IAH10 (83KF, BIOS QGCN35WW). Neither mainline
nor the series binds here. This firmware has no
LENOVO_CAPABILITY_DATA_01 in _WDG at all, so no component ever
registers for that match and lwmi_om_master_bind() never runs. Skipping
the match for GUIDs the firmware doesn't declare fixes it:
diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x86/lenovo/wmi-capdata.c
index 805e36ef7..d64520be1 100644
--- a/drivers/platform/x86/lenovo/wmi-capdata.c
+++ b/drivers/platform/x86/lenovo/wmi-capdata.c
@@ -76,11 +76,13 @@ enum lwmi_cd_type {
#define LWMI_CD_TABLE_ITEM(_type) \
[_type] = { \
.name = #_type, \
+ .guid = _type##_GUID, \
.type = _type, \
}
static const struct lwmi_cd_info {
const char *name;
+ const char *guid;
enum lwmi_cd_type type;
} lwmi_cd_table[] = {
LWMI_CD_TABLE_ITEM(LENOVO_CAPABILITY_DATA_00),
@@ -166,6 +168,14 @@ void lwmi_cd_match_add_all(struct device *master, struct component_match **match
if (lwmi_cd_table[i].type == LENOVO_FAN_TEST_DATA)
continue;
+ /*
+ * Some firmware does not declare every capdata GUID at all, in
+ * which case no component would ever register for it and the
+ * master could never bind.
+ */
+ if (!wmi_has_guid(lwmi_cd_table[i].guid))
+ continue;
+
component_match_add(master, matchptr, lwmi_cd_match,
(void *)&lwmi_cd_table[i].type);
if (IS_ERR(*matchptr))
diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86/lenovo/wmi-other.c
index e6c8f6bcf..b196e9926 100644
--- a/drivers/platform/x86/lenovo/wmi-other.c
+++ b/drivers/platform/x86/lenovo/wmi-other.c
@@ -1704,6 +1704,8 @@ static int lwmi_other_probe(struct wmi_device *wdev, const void *context)
lwmi_cd_match_add_all(&wdev->dev, &master_match);
if (IS_ERR(master_match))
return PTR_ERR(master_match);
+ if (!master_match)
+ return -ENODEV;
return component_master_add_with_match(&wdev->dev, &lwmi_om_master_ops,
master_match);
With that on top (built out of tree against 7.2.5), lenovo_wmi_other
binds and exposes fan1 and fan4 (min 1500/1800, max 5100/5400, input
matching the EC tach fields). fanX_target pins both fans, 0 hands them
back to the firmware curve, and out-of-range writes get -EINVAL. With
the change above:
Tested-by: Navon John Lukose <navonjohnlukose@xxxxxxxxx>