Re: [PATCH 0/9] platform/x86: lenovo-wmi-{other,capdata,helpers}: Improve robustness on buggy firmware

From: Mark Pearson

Date: Mon Sep 28 2026 - 12:09:35 EST




On Sat, Sep 26, 2026, at 11:01 PM, Rong Zhang wrote:
> Hi Navon,
>
> Thanks a lot for your test.
>
>
> 于 2026年9月27日 GMT+08:00 05:04:15,Navon John Lukose
> <navonjohnlukose@xxxxxxxxx> 写道:
>> 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;
>
> This was exactly what I did in the earlier revision while I was
> introducing the support for capdata00 and capdata_fan.
>
> The wmi_has_guid() approach was eventually replaced by the
> sub-component approach, because the use of the former is strongly
> discouraged.
>
> In the next revision I am going to convert capdata01 into a
> sub-component, too. In this manner some heavy and complex work in the
> series will become needless and can be simplified. While the
> sub-component approach itself is complex, we've had the infrastructure
> to make it work. Therefore wiring it up should be a trivial work.
>
> Mark, Derek,
>
> Do you know if there is any way to determine the existence of capdata01
> using capdata00?
>
Note that I can see I'm afraid

I'm guessing the patch Armin posted on my thread "[RFC PATCH 5/7] platform/x86: think-lmi: Initial ThinkLMI v2 driver" to check if it exists won't help here?

Mark