From nobody Fri Sep 25 11:08:08 2026 Received: from sender6-op-o15.zoho.com (sender6-op-o15.zoho.com [165.173.180.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C3BB2D9EE4; Sun, 13 Sep 2026 20:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.180.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332649; cv=pass; b=sQCRlTb78hzQkUbry8EsWDHqOn34+/jYhJsfbjDiXe69FrLf7bnIWmcuYyeKVjiW2xZ5E5v+fKbjyHQ57cr8ksP+ETJDNCPcB9sd3bdSuvwzcIu1hodDqNenBIXEfy84a1h41ksieC5HPWlkYwJhUbXLwXIn/KoQ9NcJi32yVPE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332649; c=relaxed/simple; bh=QexOzfbfHvHbP8QAub7mNrntBQ4goENKAGtRFZkgPlM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZWYe5KQBVX4NuHdVdNIdZj8rN9qBYnmykKN9QFIfCd6GqE6+WiTI3hMzFj/S38wV4tnlQrexU9VAtVUBXFGgQT99L5JlX50xNu1HffR38fj7JhCfuqLitryVOhy9dhwTFeTh67DuxLxjIbMZscApYCoWqyOj5YxER7FkVsE+VwQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=hBPWOWy8; arc=pass smtp.client-ip=165.173.180.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="hBPWOWy8" ARC-Seal: i=1; a=rsa-sha256; t=1789332632; cv=none; d=zohomail.com; s=zohoarc; b=ebWWw7qVxVtPgO8108B5qIDKVdEQALn9shHT13nSS/eQNl6SC4FjAjI0UMGogbTzyKhPy8LpPfhBKpa6lvbiuQRb2dC3vOvKiPpSACvySj/C3y7D5rbFvYTz7CgOvZcYtZPqpMU61JHzx2lbC5nfe79mvWzrs2GQ2gcAx7npaiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332632; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=U1AcDlbyh7bW0hsJo3k0PHp6dPtQpCOqVlcpaw4sph0=; b=mgCGiFK2sNY8LjoGOlgKHotLeF9499e7BhvgyI4L4PI9OeJmss1WL07LdM8zCyuMocnjt1p63SL9EI/lCKtfQnMC/xC+lWQHIGl3ztzjsFaUP2qqEqLkBvMLdgkPSxDOmmg1gT5nUotW1u/NwebNfHzc15rvErisFVQGi1dld8A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332632; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=U1AcDlbyh7bW0hsJo3k0PHp6dPtQpCOqVlcpaw4sph0=; b=hBPWOWy8BbZso5WFWuMXo08Oc9u+5HUWGOENqD3U03txOdfViT9xEj0jh9KzeGxp tg7+uwT+KorlDftYfodLL/utOofGXo8trpkfusMFYB9tg6BMNAAZrj7nc00QXrEA8vg SDsHg2+VztNYFl6hvoNWoqYvr4hc/vtqgJh7J6D2ATtpzePuRqXUiT4AbyPBuic0XI9 MBTAEbiPHVrE6BZOSJLur5lRQZePSEHBj3L0UN1avJDpIJOFxb0//jX7n6tGvRANHyn 99fipUB4KF9GU9CnY5UxWFVKxeARnTSdBLmlU1APlhU2HDM1mVF4hGr2Q1G1pUT2fhG 1EpZpuIBOg== Received: by smtp.zohomail.com with SMTPS id 1789332631896438.93239606933537; Sun, 13 Sep 2026 13:50:31 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:22 +0800 Subject: [PATCH 1/9] platform/x86: lenovo-wmi-capdata: Only allocate sub-master info when necessary Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-1-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External When capdata00 declares no fan test support, there is no need to allocate sub-master info as it's basically unused except for the priv->sub_master->sub_component_list =3D=3D ERR_PTR(-ENODEV) placeholder. Therefore, only allocate priv->sub_master when necessary, otherwise its absence implies the absence of sub-component. With that, PTR_ERR(sub_component_list) =3D=3D -ENODEV is repurposed for the following changes to represent stubbed sub-component. Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 36 ++++++++++++++++++---------= ---- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index d5e961566136..c9e4380a70d2 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -101,9 +101,11 @@ struct lwmi_cd_priv { struct lwmi_cd_sub_master_priv { struct device *master_dev; cd_list_cb_t master_cb; - struct cd_list *sub_component_list; /* ERR_PTR(-ENODEV) implies no sub-c= omponent. */ + struct cd_list *sub_component_list; /* ERR_PTR(-ENODEV) implies stubbed + * sub-component. + */ bool registered; /* Has the sub-master been registere= d? */ - } *sub_master; + } *sub_master; /* NULL implies no sub-compon= ent. */ }; =20 struct cd_list { @@ -258,6 +260,12 @@ static int lwmi_cd_component_bind(struct device *cd_de= v, case LENOVO_CAPABILITY_DATA_00: binder->cd00_list =3D priv->list; =20 + /* Missing sub-master info implies missing sub-component. */ + if (!priv->sub_master) { + binder->cd_fan_list_cb(om_dev, NULL); + break; + } + priv->sub_master->master_dev =3D om_dev; priv->sub_master->master_cb =3D binder->cd_fan_list_cb; lwmi_cd_call_master_cb(priv); @@ -288,13 +296,9 @@ static void lwmi_cd_component_unbind(struct device *cd= _dev, { struct lwmi_cd_priv *priv =3D dev_get_drvdata(cd_dev); =20 - switch (priv->list->type) { - case LENOVO_CAPABILITY_DATA_00: + if (priv->sub_master) { priv->sub_master->master_dev =3D NULL; priv->sub_master->master_cb =3D NULL; - return; - default: - return; } } =20 @@ -369,17 +373,19 @@ static int lwmi_cd_sub_master_add(struct lwmi_cd_priv= *priv, struct component_match *master_match =3D NULL; int ret; =20 + /* + * If the sub-master has no sub-component, there is no need to allocate + * or register the sub-master. The master callback will be called with + * NULL on master <-> sub-master bind to inform the master about the + * absence of sub-component. + */ + if (sub_component_type =3D=3D CD_TYPE_NONE) + return 0; + priv->sub_master =3D devm_kzalloc(&priv->wdev->dev, sizeof(*priv->sub_mas= ter), GFP_KERNEL); if (!priv->sub_master) return -ENOMEM; =20 - if (sub_component_type =3D=3D CD_TYPE_NONE) { - /* The master callback will be called with NULL on bind. */ - priv->sub_master->sub_component_list =3D ERR_PTR(-ENODEV); - priv->sub_master->registered =3D false; - return 0; - } - /* * lwmi_cd_match() needs a pointer to enum lwmi_cd_type, but on-stack * data cannot be used here. Steal one from lwmi_cd_table. @@ -404,7 +410,7 @@ static int lwmi_cd_sub_master_add(struct lwmi_cd_priv *= priv, */ static void lwmi_cd_sub_master_del(struct lwmi_cd_priv *priv) { - if (!priv->sub_master->registered) + if (!priv->sub_master || !priv->sub_master->registered) return; =20 component_master_del(&priv->wdev->dev, &lwmi_cd_sub_master_ops); --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender5-op-o15.zoho.com (sender5-op-o15.zoho.com [165.173.182.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1280637E5E9; Sun, 13 Sep 2026 20:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332657; cv=pass; b=GB9KkIYQMrJ/BEeAf/7K0jO4z65K3D2t5uIl6OD93cJtf3ow9CV4UKSEBxJwpVFFygw6n2mF8z6fqEC2h2BC+OwLd9qhhvZRNWuqMwjkmywNFvpmu4WOSJDZIlVPg7yiBHckQyxjsdyJzZvkabpQLzznXhY4yeBuy7Q4nLtgQso= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332657; c=relaxed/simple; bh=PZKD+TZqXk983BA5ghI12sxmqS+qbdOrtBXiFovKh80=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iy5N78RFmmF9V8fiQrMCEWVzsxZ28YSMCpbecBaG/rOE5xG7U8EL/sJmQekuawCsqHqthoeCyyYkexiUPVafWNZGoSDBsFEqcu4e5w01YOtGe/4BtF58jifN0F9CJxhoo1EFQSmiQtEcizx/NDWZF1bO9tpPg7dtCoBoPcomt+I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=CVbUZv1e; arc=pass smtp.client-ip=165.173.182.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="CVbUZv1e" ARC-Seal: i=1; a=rsa-sha256; t=1789332636; cv=none; d=zohomail.com; s=zohoarc; b=Pp52veHur0T4eqkK+F8njMnIZS4RYOvTbZarJuJe/wTK8bIxC4loYFhJyrnaeQb/bRVLeRw1r0Pc+iwN6EDVrDaBKcYkkzjE6Ln5sqA3qM90RG9rBxOOHJq4ZsL7A9sEXPjWdaCiajU6jHan9r28duP/ddQLDfQ8b/r58JWwDJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332636; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=5qqAx6oe9xriIxfBryrhNEbVbUw/GGX/ebb7CoPUr7Y=; b=O9XHm1938qBOw9m1CdEVlzhnVJudiul7LdT13kopphTRF9lsMq8ZWHiudRT/fcMTR4HBLFnF1eBG69F9AbpUbXmdTRQVqmwtPF7P4vF3qAcUuUR4ioCdh6FlfLvO4/semE+RG/W+Pou0ngZCTXp6Mzc7lj59fr3S8PWRQO6iQSU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332636; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=5qqAx6oe9xriIxfBryrhNEbVbUw/GGX/ebb7CoPUr7Y=; b=CVbUZv1ejqMy34o5X34ClR596ZQ54ACgMVR16c5JvUiEojYENDPHPTBYMWfnjDK6 U6po8gdGrJr9dynqt5GHpeKNhu/9hYlP7HXTHDuDwC++UFYZcjPq0rFk0rN22pmc54k 1Go6lR+WQ4RFCdvXo9cw5vy32EY4G75okbgqYYJ8y9zifMF/58BWtJixTVS5LQgIwrX kr0m1x409n9FRHUPurOLFgkDDB2F9T6uhDsyQrIYziXiCa0uiBBMEDeZsv1dkyAUznd 6r0tnI7U6F7/JiLSA398HkzAA/18PbG8fgjTgn4xC+94/BO9HeOrBzIHy6aqsJ67mZk ifqMIDizZA== Received: by smtp.zohomail.com with SMTPS id 1789332634589517.8181414359683; Sun, 13 Sep 2026 13:50:34 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:23 +0800 Subject: [PATCH 2/9] platform/x86: lenovo-wmi-capdata: Store a pointer to component info Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-2-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External In the following changes, priv->list will become optional (i.e., NULLable). IOW, the type of the component cannot be reliable retrieved from priv->list->type. Store a pointer to component info so that the component type is always available. In this manner, priv->list->type can be eliminated. Note that the component type check in lwmi_cd*_get_data() must be removed due to it being called without the availability of priv. Removing it should be fine as the capdata APIs are really internal methods and their caller, i.e., lenovo-wmi-other, always passes a matched list. This also eliminates the need to pass the component type along setup functions. Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 44 +++++++++++++--------------= ---- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index c9e4380a70d2..880ac444c206 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -87,6 +87,7 @@ static const struct lwmi_cd_info { =20 struct lwmi_cd_priv { struct notifier_block acpi_nb; /* ACPI events */ + const struct lwmi_cd_info *info; struct wmi_device *wdev; struct cd_list *list; struct dentry *debugfs_dir; @@ -110,7 +111,6 @@ struct lwmi_cd_priv { =20 struct cd_list { struct mutex list_mutex; /* list R/W mutex */ - enum lwmi_cd_type type; u8 count; =20 union { @@ -139,7 +139,7 @@ static int lwmi_cd_match(struct device *dev, void *type) return false; =20 priv =3D dev_get_drvdata(dev); - return priv->list->type =3D=3D *(enum lwmi_cd_type *)type; + return priv->info->type =3D=3D *(enum lwmi_cd_type *)type; } =20 /** @@ -256,7 +256,7 @@ static int lwmi_cd_component_bind(struct device *cd_dev, struct lwmi_cd_priv *priv =3D dev_get_drvdata(cd_dev); struct lwmi_cd_binder *binder =3D data; =20 - switch (priv->list->type) { + switch (priv->info->type) { case LENOVO_CAPABILITY_DATA_00: binder->cd00_list =3D priv->list; =20 @@ -454,14 +454,11 @@ static const struct component_ops lwmi_cd_sub_compone= nt_ops =3D { * * Return: 0 on success, or -EINVAL. */ -#define DEF_LWMI_CDXX_GET_DATA(_cdxx, _cd_type, _output_t) \ +#define DEF_LWMI_CDXX_GET_DATA(_cdxx, _output_t) \ int lwmi_##_cdxx##_get_data(struct cd_list *list, u32 attribute_id, _outp= ut_t *output) \ { \ u8 idx; \ \ - if (WARN_ON(list->type !=3D _cd_type)) \ - return -EINVAL; \ - \ guard(mutex)(&list->list_mutex); \ for (idx =3D 0; idx < list->count; idx++) { \ if (list->_cdxx[idx].id !=3D attribute_id) \ @@ -472,13 +469,13 @@ static const struct component_ops lwmi_cd_sub_compone= nt_ops =3D { return -EINVAL; \ } =20 -DEF_LWMI_CDXX_GET_DATA(cd00, LENOVO_CAPABILITY_DATA_00, struct capdata00); +DEF_LWMI_CDXX_GET_DATA(cd00, struct capdata00); EXPORT_SYMBOL_NS_GPL(lwmi_cd00_get_data, "LENOVO_WMI_CAPDATA"); =20 -DEF_LWMI_CDXX_GET_DATA(cd01, LENOVO_CAPABILITY_DATA_01, struct capdata01); +DEF_LWMI_CDXX_GET_DATA(cd01, struct capdata01); EXPORT_SYMBOL_NS_GPL(lwmi_cd01_get_data, "LENOVO_WMI_CAPDATA"); =20 -DEF_LWMI_CDXX_GET_DATA(cd_fan, LENOVO_FAN_TEST_DATA, struct capdata_fan); +DEF_LWMI_CDXX_GET_DATA(cd_fan, struct capdata_fan); EXPORT_SYMBOL_NS_GPL(lwmi_cd_fan_get_data, "LENOVO_WMI_CAPDATA"); =20 /* =3D=3D=3D=3D=3D=3D=3D=3D debugfs =3D=3D=3D=3D=3D=3D=3D=3D */ @@ -552,15 +549,14 @@ static int lwmi_cd_debugfs_show(struct seq_file *s, v= oid *data) =20 guard(mutex)(&priv->list->list_mutex); =20 - /* lwmi_cd_alloc() ensured priv->list->type must be a valid type. */ for (idx =3D 0; idx < priv->list->count; idx++) { - seq_printf(s, "%s[%u]:\n", lwmi_cd_table[priv->list->type].name, idx); + seq_printf(s, "%s[%u]:\n", priv->info->name, idx); =20 - if (priv->list->type =3D=3D LENOVO_CAPABILITY_DATA_00) + if (priv->info->type =3D=3D LENOVO_CAPABILITY_DATA_00) lwmi_cd00_show(s, &priv->list->cd00[idx]); - else if (priv->list->type =3D=3D LENOVO_CAPABILITY_DATA_01) + else if (priv->info->type =3D=3D LENOVO_CAPABILITY_DATA_01) lwmi_cd01_show(s, &priv->list->cd01[idx]); - else if (priv->list->type =3D=3D LENOVO_FAN_TEST_DATA) + else if (priv->info->type =3D=3D LENOVO_FAN_TEST_DATA) lwmi_cd_fan_show(s, &priv->list->cd_fan[idx]); } =20 @@ -605,7 +601,7 @@ static int lwmi_cd_cache(struct lwmi_cd_priv *priv) int idx; void *p; =20 - switch (priv->list->type) { + switch (priv->info->type) { case LENOVO_CAPABILITY_DATA_00: p =3D &priv->list->cd00[0]; size =3D sizeof(priv->list->cd00[0]); @@ -708,14 +704,13 @@ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_c= d_priv *priv, struct cd_lis /** * lwmi_cd_alloc() - Allocate a cd_list struct in drvdata * @priv: lenovo-wmi-capdata driver data. - * @type: The type of capability data. * * Allocate a cd_list struct large enough to contain data from all WMI data * blocks provided by the interface. * * Return: 0 on success, or an error. */ -static int lwmi_cd_alloc(struct lwmi_cd_priv *priv, enum lwmi_cd_type type) +static int lwmi_cd_alloc(struct lwmi_cd_priv *priv) { struct cd_list *list; size_t list_size; @@ -723,7 +718,7 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv, enu= m lwmi_cd_type type) =20 count =3D wmidev_instance_count(priv->wdev); =20 - switch (type) { + switch (priv->info->type) { case LENOVO_CAPABILITY_DATA_00: list_size =3D struct_size(list, cd00, count); break; @@ -749,7 +744,6 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv, enu= m lwmi_cd_type type) if (ret) return ret; =20 - list->type =3D type; list->count =3D count; priv->list =3D list; =20 @@ -759,7 +753,6 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv, enu= m lwmi_cd_type type) /** * lwmi_cd_setup() - Cache all WMI data block information * @priv: lenovo-wmi-capdata driver data. - * @type: The type of capability data. * * Allocate a cd_list struct large enough to contain data from all WMI data * blocks provided by the interface. Then loop through each data block and @@ -767,11 +760,11 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv, e= num lwmi_cd_type type) * * Return: 0 on success, or an error code. */ -static int lwmi_cd_setup(struct lwmi_cd_priv *priv, enum lwmi_cd_type type) +static int lwmi_cd_setup(struct lwmi_cd_priv *priv) { int ret; =20 - ret =3D lwmi_cd_alloc(priv, type); + ret =3D lwmi_cd_alloc(priv); if (ret) return ret; =20 @@ -838,10 +831,11 @@ static int lwmi_cd_probe(struct wmi_device *wdev, con= st void *context) if (!priv) return -ENOMEM; =20 + priv->info =3D info; priv->wdev =3D wdev; dev_set_drvdata(&wdev->dev, priv); =20 - ret =3D lwmi_cd_setup(priv, info->type); + ret =3D lwmi_cd_setup(priv); if (ret) goto out; =20 @@ -907,7 +901,7 @@ static void lwmi_cd_remove(struct wmi_device *wdev) =20 lwmi_cd_debugfs_remove(priv); =20 - switch (priv->list->type) { + switch (priv->info->type) { case LENOVO_CAPABILITY_DATA_00: lwmi_cd_sub_master_del(priv); fallthrough; --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender6-op-o15.zoho.com (sender6-op-o15.zoho.com [165.173.180.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5006C37EFE4; Sun, 13 Sep 2026 20:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.180.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332666; cv=pass; b=apDyWDxF14FTWBZPvE+kydi+eMNig77sHdbwMtOVn6IJ7NCfj8w4qSsPGa7Zkf/7egFbZxw7FRfGdIOzlkSdTo30ISzlg1LSeUlhCPdKG95scM8KYjdH9VqWw5XvA+3Tl21/Db31zzpWL/+VydkYG2LGOxsWDFdVAyvUpUxAwNs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332666; c=relaxed/simple; bh=l8vbbq6mwRKkVEYwXPLOgBo+K+uGL6lmzJ5V5xl4hmU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Rt7zF9bjV7l8A36BzOi5dDKQKw4FAIIvHN9KUjMsMWxlb51tnzUd2SmG0QtJ0LxNeEJMJBmOeXHyDkFw7tEPU6hUag0M7s/162y4sQaNKeJY4/uB/VvjyW+mBAojX9wW8eu82KE9fE/HM5leX7WMH9M8d9AnGCSyEOnRNRtAujs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=PHH5ab0W; arc=pass smtp.client-ip=165.173.180.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="PHH5ab0W" ARC-Seal: i=1; a=rsa-sha256; t=1789332638; cv=none; d=zohomail.com; s=zohoarc; b=iF3iYnyWNgFLzZkLq60iJQqVz6mYzp1ZzJXh4Pz/x8vNtL58qTU8VJcDh1ytBJlqiGW45bWokw5jAlQ45cNYG5lVdAv9kG70bVe62nArF05nSZwOHjCQQoGnGkzR/J8Z86upx/Low4Of7kUSWBJJBfI8W0LbUcfnyK64rmk1LLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332638; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=nZLTOWbhasXWCYrctDiJmJMxmIn8+t6ASx9j0zGBUCM=; b=KQSmf01Guj2AKmb81MuD+T8qPXnWVQGA1UDTB5seA7dOgFat0LpnDK+Cao4afS1pGSvXHwJijPrQSF4Gik6GFi6y2mNT48R7+y8fOfrCBQeHOQl7UirDGqHv4gSPvp3kXGbuIhnPYNkKgc5bTH4AqWsJI8a8/OnYTRhTAU7U41w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332638; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=nZLTOWbhasXWCYrctDiJmJMxmIn8+t6ASx9j0zGBUCM=; b=PHH5ab0WjrPaXkk4pDiGZ1xVQL0tvrvqKPfK1q5+e/2wsQO5hY/HhU3f2rZJlptp 9ADVdF6NIgM4FmEQqdOlFgwolvxDC8CmNOJQeEEXI1BI3lbiquptDWSNVUUwS443yHO JpA+SCEQpHHAr5DrwGma6HbC+SpPnVmjHbBnX/IxvT6ykPUJXsJX08CM7VSHPX+fcUy +3zDP+ZNnB6SNSrjw3rxyO4zs/XZ3Iu0B142q7FVo7Oc0uhcx2OwFY0LCbM7SME2ZGa 5J1c3N77PPnG/CyIOthMUI9+2XVAGHYIkNwLNeUYmu8Rq6SwmvV6gqZEBtKn8Vj+0il RfKvKXGVRg== Received: by smtp.zohomail.com with SMTPS id 1789332637266489.3839651910447; Sun, 13 Sep 2026 13:50:37 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:24 +0800 Subject: [PATCH 3/9] platform/x86: lenovo-wmi-capdata: Defer mutex initialization Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-3-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External In the following changes, priv->list may be freed if the first call to lwmi_cd_cache() fails due to WMI/ACPI errors, so the list_mutex must be initialized after it in order not to break lockdep, as there is no devm_mutex_destroy(). Considering that the first call to lwmi_cd_cache() doesn't need serialization as there is no other reader or writer this early, the initialization of list_mutex can be deferred. Therefore, initialize list_mutex only after the first call to lwmi_cd_cache() succeeds, otherwise it remains uninitialized and can be devm_kfree()-ed. Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 80 +++++++++++++++++++++++----= ---- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index 880ac444c206..0123ec8f7b53 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -91,6 +91,7 @@ struct lwmi_cd_priv { struct wmi_device *wdev; struct cd_list *list; struct dentry *debugfs_dir; + bool initialized; =20 /* * A capdata device may be a component master of another capdata device. @@ -588,14 +589,14 @@ static void lwmi_cd_debugfs_remove(struct lwmi_cd_pri= v *priv) /* =3D=3D=3D=3D=3D=3D=3D=3D WMI interface =3D=3D=3D=3D=3D=3D=3D=3D */ =20 /** - * lwmi_cd_cache() - Cache all WMI data block information + * __lwmi_cd_cache() - Cache all WMI data block information locklessly * @priv: lenovo-wmi-capdata driver data. * - * Loop through each WMI data block and cache the data. + * Loop through each WMI data block and cache the data locklessly. * * Return: 0 on success, or an error. */ -static int lwmi_cd_cache(struct lwmi_cd_priv *priv) +static int __lwmi_cd_cache(struct lwmi_cd_priv *priv) { size_t size; int idx; @@ -617,7 +618,6 @@ static int lwmi_cd_cache(struct lwmi_cd_priv *priv) return -EINVAL; } =20 - guard(mutex)(&priv->list->list_mutex); for (idx =3D 0; idx < priv->list->count; idx++, p +=3D size) { union acpi_object *ret_obj __free(kfree) =3D NULL; =20 @@ -635,14 +635,37 @@ static int lwmi_cd_cache(struct lwmi_cd_priv *priv) return 0; } =20 +/** + * lwmi_cd_cache() - Cache all WMI data block information + * @priv: lenovo-wmi-capdata driver data. + * + * Loop through each WMI data block and cache the data. + * + * Return: 0 on success, or an error. + */ +static int lwmi_cd_cache(struct lwmi_cd_priv *priv) +{ + if (!priv->initialized) + return __lwmi_cd_cache(priv); + + switch (priv->info->type) { + case LENOVO_CAPABILITY_DATA_01: + break; + default: + return -EINVAL; + } + + guard(mutex)(&priv->list->list_mutex); + return __lwmi_cd_cache(priv); +} + /** * lwmi_cd_fan_list_alloc_cache() - Alloc and cache Fan Test Data list * @priv: lenovo-wmi-capdata driver data. - * @listptr: Pointer to returned cd_list pointer. * * Return: count of fans found, or an error. */ -static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_priv *priv, struct = cd_list **listptr) +static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_priv *priv) { struct cd_list *list; size_t size; @@ -688,6 +711,9 @@ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_= priv *priv, struct cd_lis if (!list) return -ENOMEM; =20 + list->count =3D count; + priv->list =3D list; + for (idx =3D 0; idx < count; idx++) { /* Do not calculate array index using count, as it may be truncated. */ list->cd_fan[idx] =3D (struct capdata_fan) { @@ -697,8 +723,7 @@ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_= priv *priv, struct cd_lis }; } =20 - *listptr =3D list; - return count; + return 0; } =20 /** @@ -714,7 +739,7 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv) { struct cd_list *list; size_t list_size; - int count, ret; + int count; =20 count =3D wmidev_instance_count(priv->wdev); =20 @@ -726,11 +751,7 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv) list_size =3D struct_size(list, cd01, count); break; case LENOVO_FAN_TEST_DATA: - count =3D lwmi_cd_fan_list_alloc_cache(priv, &list); - if (count < 0) - return count; - - goto got_list; + return lwmi_cd_fan_list_alloc_cache(priv); default: return -EINVAL; } @@ -739,17 +760,32 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv) if (!list) return -ENOMEM; =20 -got_list: - ret =3D devm_mutex_init(&priv->wdev->dev, &list->list_mutex); - if (ret) - return ret; - list->count =3D count; priv->list =3D list; =20 return 0; } =20 +/** + * lwmi_cd_finalize() - Finalize the capability data initialization + * @priv: lenovo-wmi-capdata driver data. + * + * Return: 0 on success, or an error code. + */ +static int lwmi_cd_finalize(struct lwmi_cd_priv *priv) +{ + int ret; + + if (priv->list) { + ret =3D devm_mutex_init(&priv->wdev->dev, &priv->list->list_mutex); + if (ret) + return ret; + } + + priv->initialized =3D 1; + return 0; +} + /** * lwmi_cd_setup() - Cache all WMI data block information * @priv: lenovo-wmi-capdata driver data. @@ -768,7 +804,11 @@ static int lwmi_cd_setup(struct lwmi_cd_priv *priv) if (ret) return ret; =20 - return lwmi_cd_cache(priv); + ret =3D lwmi_cd_cache(priv); + if (ret) + return ret; + + return lwmi_cd_finalize(priv); } =20 /** --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender6-op-o15.zoho.com (sender6-op-o15.zoho.com [165.173.180.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC7BE369D7C; Sun, 13 Sep 2026 20:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.180.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332675; cv=pass; b=K4MEg/gPr6U5CKnbJFkr3aai9GO+hfDuIcZRfdwRD4hoB1RxKcVZseuFP4X68o6EUC/HRS2wL+lu9Ydni+QMw+IipYCDVawEdQdG1eTjoC2wpOXcC1Q2cojDRGQDuzkNtgf7XKEUa2gHCjfeWbGHsrnZp561N3Vqeh1dL+TEtkY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332675; c=relaxed/simple; bh=4Iulpe0xHQceJQG8ACsvxWXwolEzEnojR200TkzITBA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bpt967jXjQnK9xbss22N4FNlikPnxI2X+Vpln++bKf2KM3qsKaILTucBBEgLvaqClyW0yYpy8i5IDD+jD5xJ0AHY7Ex6dhAU6IbeISOUaXC9C1jc8+3ugPXPqlz9PVKgBiXmm/DBo4TTWYCZTxMe+MIZ6VaT9n4y8rCrvEfFfQo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=pntnUv+f; arc=pass smtp.client-ip=165.173.180.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="pntnUv+f" ARC-Seal: i=1; a=rsa-sha256; t=1789332640; cv=none; d=zohomail.com; s=zohoarc; b=EgoM/CkBi2Dn0+gyosp+rgsbm47c3EqWYMFNtw1PS/Yd1Sw0MbRDSS8DUbdIf/E9EkFqZvKSaoEXy71tWnt5zfNCpOXGbWVJZ4TPmZ0z5OAqQcrpgd1EIdJZ4CXXBAFCUcoERrmHRxkvYvZnpSrjDhhSbtV1GX1smZFiBibjoRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332640; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=80ZfP9i37GSfGsF2Fhe7TLyYHVP9wOXmVluAG0L8mPo=; b=HFRB/GIfpMW7N9DTG3pCsIyRQWkW2yiXhV+shGWirEoAI4zGSNQ4bgRvgT5sHOLF9enp6gBvd/poEcjz0rjrp6DhRTbwdak8AVZGiNOSfe++wIw2p+uQZvKR0BOOLH4dlVKnGAhZiM9wLYbKTVy1eBI5Vk1o/9fE/OZddQ4Amuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332640; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=80ZfP9i37GSfGsF2Fhe7TLyYHVP9wOXmVluAG0L8mPo=; b=pntnUv+f6jEkD4xNQUWI3wprknj52TUEWq4mYzJhL2NYZzo8jUyinf0zdKL4g3qI mu0BIs2If8gjn3hEqemXSmgHq3U4r8uMNHSgb8Ia2beSbwA06pUZil1gfKF3nVypYq/ 0cYidKICsSITuyp/Kr8noChNS2AFV62a9WaA/ro4TRLkun22JqBbOkBH9Ehn/bUMLgC 6bdXCtM1QCrOkf8RmwBycPy2cxK/5+HF1Da7sJ5iiSpsl3D2okaNX13o1u9HIqua5MT 4dYeIqJxH8fI/GfFy7ipPWs1mKPO9J4VKKEaxB2AChCaIXt127YRzcxwVP+YoR3y4mj nroH6g9CRA== Received: by smtp.zohomail.com with SMTPS id 178933263996357.370519965290555; Sun, 13 Sep 2026 13:50:39 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:25 +0800 Subject: [PATCH 4/9] platform/x86: lenovo-wmi-{capdata,other}: Only allocate capdata list when necessary Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-4-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External When no capability data is available, there is no need to allocate capability data list as it's basically unused except for the priv->list->count =3D=3D 0 placeholder. Therefore, only allocate priv->list when necessary, otherwise its absence implies the absence of capability data. In this manner, lenovo-wmi-other can skip registering unavailable functionalities accordingly. Meanwhile, skip creating the debugfs directory as it provides nothing when there is no capability data. Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 43 ++++++++++++++++++++++-----= ---- drivers/platform/x86/lenovo/wmi-other.c | 11 +++++--- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index 0123ec8f7b53..793b5103d533 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -313,8 +313,8 @@ static const struct component_ops lwmi_cd_component_ops= =3D { * @dev: The sub-master capdata basic device. * * Call component_bind_all to bind the sub-component device to the sub-mas= ter - * device. On success, collect the pointer to the sub-component list and t= ry - * to call the master callback. + * device. On success, collect the pointer (or ERR_PTR(-ENODEV) if it's st= ubbed) + * to the sub-component list and try to call the master callback. * * Return: 0 on success, or an error code. */ @@ -328,7 +328,7 @@ static int lwmi_cd_sub_master_bind(struct device *dev) if (ret) return ret; =20 - priv->sub_master->sub_component_list =3D sub_component_list; + priv->sub_master->sub_component_list =3D sub_component_list ?: ERR_PTR(-E= NODEV); lwmi_cd_call_master_cb(priv); =20 return 0; @@ -460,6 +460,9 @@ static const struct component_ops lwmi_cd_sub_component= _ops =3D { { \ u8 idx; \ \ + if (WARN_ON(!list)) \ + return -EINVAL; \ + \ guard(mutex)(&list->list_mutex); \ for (idx =3D 0; idx < list->count; idx++) { \ if (list->_cdxx[idx].id !=3D attribute_id) \ @@ -571,6 +574,9 @@ DEFINE_SHOW_ATTRIBUTE(lwmi_cd_debugfs); */ static void lwmi_cd_debugfs_add(struct lwmi_cd_priv *priv) { + if (!priv->list) + return; + priv->debugfs_dir =3D lwmi_debugfs_create_dir(priv->wdev); =20 debugfs_create_file("capdata", 0444, priv->debugfs_dir, priv, &lwmi_cd_de= bugfs_fops); @@ -582,6 +588,7 @@ static void lwmi_cd_debugfs_add(struct lwmi_cd_priv *pr= iv) */ static void lwmi_cd_debugfs_remove(struct lwmi_cd_priv *priv) { + /* Debugfs can handle NULL dir, no need to check. */ debugfs_remove_recursive(priv->debugfs_dir); priv->debugfs_dir =3D NULL; } @@ -645,6 +652,9 @@ static int __lwmi_cd_cache(struct lwmi_cd_priv *priv) */ static int lwmi_cd_cache(struct lwmi_cd_priv *priv) { + if (!priv->list) + return 0; + if (!priv->initialized) return __lwmi_cd_cache(priv); =20 @@ -707,6 +717,9 @@ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_= priv *priv) count =3D 0; } =20 + if (!count) + return 0; + list =3D devm_kzalloc(&priv->wdev->dev, struct_size(list, cd_fan, count),= GFP_KERNEL); if (!list) return -ENOMEM; @@ -742,6 +755,8 @@ static int lwmi_cd_alloc(struct lwmi_cd_priv *priv) int count; =20 count =3D wmidev_instance_count(priv->wdev); + if (!count) + return 0; =20 switch (priv->info->type) { case LENOVO_CAPABILITY_DATA_00: @@ -884,7 +899,9 @@ static int lwmi_cd_probe(struct wmi_device *wdev, const= void *context) enum lwmi_cd_type sub_component_type =3D LENOVO_FAN_TEST_DATA; struct capdata00 capdata00; =20 - ret =3D lwmi_cd00_get_data(priv->list, LWMI_ATTR_ID_FAN_TEST, &capdata00= ); + ret =3D priv->list + ? lwmi_cd00_get_data(priv->list, LWMI_ATTR_ID_FAN_TEST, &capdata00) + : -ENODATA; if (ret || !(capdata00.supported & LWMI_SUPP_VALID)) { dev_dbg(&wdev->dev, "capdata00 declares no fan test support\n"); sub_component_type =3D CD_TYPE_NONE; @@ -905,14 +922,16 @@ static int lwmi_cd_probe(struct wmi_device *wdev, con= st void *context) case LENOVO_CAPABILITY_DATA_01: priv->acpi_nb.notifier_call =3D lwmi_cd01_notifier_call; =20 - ret =3D register_acpi_notifier(&priv->acpi_nb); - if (ret) - goto out; + if (priv->list) { + ret =3D register_acpi_notifier(&priv->acpi_nb); + if (ret) + goto out; =20 - ret =3D devm_add_action_or_reset(&wdev->dev, lwmi_cd01_unregister, - &priv->acpi_nb); - if (ret) - goto out; + ret =3D devm_add_action_or_reset(&wdev->dev, lwmi_cd01_unregister, + &priv->acpi_nb); + if (ret) + goto out; + } =20 ret =3D component_add(&wdev->dev, &lwmi_cd_component_ops); goto out; @@ -930,7 +949,7 @@ static int lwmi_cd_probe(struct wmi_device *wdev, const= void *context) lwmi_cd_debugfs_add(priv); =20 dev_dbg(&wdev->dev, "registered %s with %u items\n", - info->name, priv->list->count); + info->name, priv->list ? priv->list->count : 0); } return ret; } diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86= /lenovo/wmi-other.c index fbb32bf404f2..e6c8f6bcf050 100644 --- a/drivers/platform/x86/lenovo/wmi-other.c +++ b/drivers/platform/x86/lenovo/wmi-other.c @@ -1643,16 +1643,19 @@ static int lwmi_om_master_bind(struct device *dev) =20 priv->cd00_list =3D binder.cd00_list; priv->cd01_list =3D binder.cd01_list; - if (!priv->cd00_list || !priv->cd01_list) { + if (!priv->cd00_list && !priv->cd01_list) { component_unbind_all(dev, NULL); =20 return -ENODEV; } =20 - lwmi_om_fan_info_collect_cd00(priv); - lwmi_om_psy_ext_init(priv); + if (priv->cd00_list) { + lwmi_om_fan_info_collect_cd00(priv); + lwmi_om_psy_ext_init(priv); + } =20 - lwmi_om_fw_attr_add(priv); + if (priv->cd01_list) + lwmi_om_fw_attr_add(priv); =20 return 0; } --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender5-op-o15.zoho.com (sender5-op-o15.zoho.com [165.173.182.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 901E937F00F; Sun, 13 Sep 2026 20:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332682; cv=pass; b=TgUQI8opqv2BAbOuP7blXvpEApAt1m6Aq+DKwxM4aEfUHkGX7NdyyEXiQuqzujy2KV2BvBiGtErseRqkWlLIHuWuT1YHvUon5J76QshfSnH5YdvluOqdNuSmlV+dwFW+aNKIVmrRGSx7Ksz87uMb8UeNg8+cRzJh7pnBXjZ5chw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332682; c=relaxed/simple; bh=NqV4g99CiI+mE+/BVC8ksJkgPBCvImucJphCyT4IBJc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TIGAwEIFy+ycWHklSDwDgXQ8A2VcnG78SJ8ryze1e7iTiJvrmQqSjM5OTE03n9rbNJqXm70FJbrjPGA5A1d5tKevM3dhIwag6WxVPJxXviwaQumbuWBYngipDo9gosCOpsysco9fM551bEJVchEj/kF3BgX4vatURU0Hjg9YF0c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=EYCELw9e; arc=pass smtp.client-ip=165.173.182.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="EYCELw9e" ARC-Seal: i=1; a=rsa-sha256; t=1789332644; cv=none; d=zohomail.com; s=zohoarc; b=UcGKL6CydZok+SnuZpj+nSxlhiSjEf90f8cffo4IQztOzML8PbTKyuXn6EBCoJw9KgMxY71RSoU00vVHpEmBicoZcNe20oDq42n1TKPUxePVVxONfUFDCWC4GMHf2ZSnxk9+AcTPxhIrceoMJjFp2y3HADwBoNzKTAAW2xs9nP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332644; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=RQjo7v7oGsuQGQPK2lmcMvmFjsRtk6ja27lpQpQTs9w=; b=OsADYDt8n94GNyrvJEhP6KFo/VjIoPi6CsJGyZslGSvHdGw8kk61E0mMci50dF8C14wZDjEkqgC3qVe6EaypcKuLAHednFaYZFtWVAV1+JdeCShxDVLFkHz0cNcxGfAAcCzSvnodibliB6+Q4xozWfco5LZlLUkJQlwl0sG2iqU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332644; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=RQjo7v7oGsuQGQPK2lmcMvmFjsRtk6ja27lpQpQTs9w=; b=EYCELw9eSL5DU/K1Dpv6CRjac7vZCpHJn2n+MP6d4bG0+3Jo/YayJ+1p5Tttvfb5 XMDPuTBjY/HGjllwKkxyf1B+8Bi4K7hjMiDUGhffQU7fnZml4ZzkugvmYt++dRjIkF+ HNVg4sEuJBixhdVUAM2P40rwNJR7IUV01AraZV1jOX7adcD8OT3FVfIIHPm4wk6w+Gq wMY/ooF6H7pwef7dd/J7DChub70Qy9Jfr3qfQHklTgTMG/20N6cCg4XHp4TZf2wjMMR SrbHR5mkHD2892Sy85gL3cbr8HFUGt7MgffDJPE9JhI+zK97iMDnFC2dDbsxMvH/L+A 8S/D99j9BQ== Received: by smtp.zohomail.com with SMTPS id 1789332642647690.5731905717419; Sun, 13 Sep 2026 13:50:42 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:26 +0800 Subject: [PATCH 5/9] platform/x86: lenovo-wmi-capdata: Adopt new WMI API Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-5-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External The new WMI API supports multiple ACPI types by converting them into a unified buffer that satisfies alignment and size requirements. Adopt it to make our life easier. Note that the new WMI API only accepts a few ACPI types to conform to the behavior of the Windows WMI-ACPI driver. By adopting the new API, we intentionally rejects improper ACPI types instead of silently ignoring them. Meanwhile, considering that `struct_size(block, data, count * 3)' may overflow when calculating `count * 3', ignore Fan Test Data with count > U8_MAX instead of caping `count'. Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 72 ++++++++++++++-------------= ---- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index 793b5103d533..5e66e6b52720 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -626,17 +626,19 @@ static int __lwmi_cd_cache(struct lwmi_cd_priv *priv) } =20 for (idx =3D 0; idx < priv->list->count; idx++, p +=3D size) { - union acpi_object *ret_obj __free(kfree) =3D NULL; + struct wmi_buffer wbuf; + int ret; =20 - ret_obj =3D wmidev_block_query(priv->wdev, idx); - if (!ret_obj) - return -ENODEV; - - if (ret_obj->type !=3D ACPI_TYPE_BUFFER || - ret_obj->buffer.length < size) + ret =3D wmidev_query_block(priv->wdev, idx, &wbuf, size); + if (ret =3D=3D -ENODATA) /* The block is too short, probably stubbed. */ continue; + if (ret) + return ret; =20 - memcpy(p, ret_obj->buffer.pointer, size); + /* Capdata 01 is an extension to capdata 00. */ + struct capdata00 *capdata __free(kfree) =3D wbuf.data; + + memcpy(p, capdata, size); } =20 return 0; @@ -677,43 +679,35 @@ static int lwmi_cd_cache(struct lwmi_cd_priv *priv) */ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_priv *priv) { + struct wmi_buffer wbuf; struct cd_list *list; - size_t size; + int ret, idx; u32 count; - int idx; =20 - /* Emit unaligned access to u8 buffer with __packed. */ struct cd_fan_block { u32 nr; u32 data[]; /* id[nr], max_rpm[nr], min_rpm[nr] */ - } __packed * block; - - union acpi_object *ret_obj __free(kfree) =3D wmidev_block_query(priv->wde= v, 0); - if (!ret_obj) - return -ENODEV; - - if (ret_obj->type =3D=3D ACPI_TYPE_BUFFER) { - block =3D (struct cd_fan_block *)ret_obj->buffer.pointer; - size =3D ret_obj->buffer.length; - - count =3D size >=3D sizeof(*block) ? block->nr : 0; - if (size < struct_size(block, data, count * 3)) { - dev_warn(&priv->wdev->dev, - "incomplete fan test data block: %zu < %zu, ignoring\n", - size, struct_size(block, data, count * 3)); - count =3D 0; - } else if (count > U8_MAX) { - dev_warn(&priv->wdev->dev, - "too many fans reported: %u > %u, truncating\n", - count, U8_MAX); - count =3D U8_MAX; - } - } else { - /* - * This is usually caused by a dummy ACPI method. Do not return an error - * as failing to probe this device will result in sub-master device being - * unbound. This behavior aligns with lwmi_cd_cache(). - */ + }; + + ret =3D wmidev_query_block(priv->wdev, 0, &wbuf, sizeof(struct cd_fan_blo= ck)); + if (ret =3D=3D -ENODATA) /* The block is too short, probably stubbed. */ + return 0; + if (ret) + return ret; + + struct cd_fan_block *block __free(kfree) =3D wbuf.data; + + count =3D block->nr; + + if (count > U8_MAX) { + dev_warn(&priv->wdev->dev, + "too many fans reported: %u > %u, ignoring\n", count, + U8_MAX); + count =3D 0; + } else if (wbuf.length < struct_size(block, data, count * 3)) { + dev_warn(&priv->wdev->dev, + "incomplete fan test data block: %zu < %zu (%u fans), ignoring\n", + wbuf.length, struct_size(block, data, count * 3), count); count =3D 0; } =20 --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B54D63783B4; Sun, 13 Sep 2026 20:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332690; cv=pass; b=YmXrU+MYlPQ/E1ibG+K4TcAu7lysb/fJiu3/sm+wYBCfToncM1Odi/k9sBQnUbEUFbmHaHjfSahek7oEcb7R240B/KC1VrZwy8XqtGuO6UCunA4cUk44pw5DYEfJWg7fN128ZgfBvCD181m8tqvrq06kxexGMu5rVVaxSDv0Aqk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332690; c=relaxed/simple; bh=tDzHL+vPxZNAgGlgZvyls2CIGXTm4N7LnYWR83lLYKs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YBnoHrkekrcLF1t4sfQbcMaI6Ehy5gK46T+MZ3q6HeA/cTv2JBu8th3Y27TpdDQqVeFVYFhFzMz84XbQo/YYE8kDV830JYTGnH0Tz4sQtaEiaS5u+Ha/57o4Or8BNcC2rb/GZ1YFjOY0XtyZRx5yk/zEGS9UyVuCTKJjiX9E/Vo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=L7DwrMuC; arc=pass smtp.client-ip=136.143.188.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="L7DwrMuC" ARC-Seal: i=1; a=rsa-sha256; t=1789332646; cv=none; d=zohomail.com; s=zohoarc; b=CRQmsuW2bFfrLTmwn5lYrC8GOrbzj523QvlzjxtEojeIXm7F31tvJDn7NF2hIZN6VUoV+Ety0PdTyJTQeCXbyjF5Yw8KB57FGJfz8c8+Uzp0STJyWoqgRzc3ZsRPcWJvscFwDU+y3rBo8QkynH28XvkzIwu6M6PWj7KqtKxLr2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332646; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=ttW3Cbvt0z93dH+e/+ikkPXywRazeEgc7HLKU1mKdz4=; b=gue8EuyNvCk5NE4nkTohJoGKI8wS603XyEYnMkyG9Z6jCNDd+tbwxjfI5xNn1eQ66M/0JBSSMIgK0un6NCPFX1fgAQ7YOyPVqH7YBcWT37Wsjha2m4MlDb/5zy5AMYeFHdU/zkdAOtiGbcvN6T6gFZGMVMwrfgdTLBxqYBGqi58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332646; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=ttW3Cbvt0z93dH+e/+ikkPXywRazeEgc7HLKU1mKdz4=; b=L7DwrMuCWU0NkjLabXhyLJ4SQeFgyyPwth/dZYTlzrbK8Er3/JfDuipuR3f+dw/I 9zNs4O2ZeTyZcXvuoNtS6zMFDv+zCyQsX5uDL1SYK+PGUvkJ5YzMLssdc+Z7kY02ZMd BYf06pG7PJg09evqa+Ck1txXNRUa64aWDwT1tyNjWyP7xJPtc03IeCn0Gap1LhbeLlD 6hqD6huxTWXYREPuLa/bpT9VYqrhnt7Ik0f6D8+NrcKHhGtfbm6hsyitjXUN2Chu0r3 fpRIuoNwTgWx2Y7PnLlIfX+uW7fo3MHpNRLPYFnsUIALeOjD6TpV4Mpl1zzSVSsNH7q Qss1xr9zZw== Received: by smtp.zohomail.com with SMTPS id 178933264530419.495999429970652; Sun, 13 Sep 2026 13:50:45 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:27 +0800 Subject: [PATCH 6/9] platform/x86: lenovo-wmi-capdata: Register component even on WMI error Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-6-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External Some devices do not support LENOVO_CAPABILITY_DATA_01 and define the query method as a stub that returns zero buffer. Unfortunately, some devices do not implement the stub properly, causing WMI errors (including ACPI errors). The current lenovo-wmi-* implementation enforces the binding between LENOVO_CAPABILITY_DATA_00+01 and LENOVO_OTHER_MODE because of a limitation of the device component framework. When the capdata device bailing out due to a WMI error, lenovo-wmi-other becomes unbound and unable to provide firmware-attributes or hwmon device for the other functional capdata device. Therefore, WMI errors must be non-fatal in order not to break the assumptions made by the device component famrework. Poison the capdata device by releasing the capability data list in this case. After that, NULL list will be passed to lenovo-wmi-other on bind. The latter will provide whatever is available, or unbind the components if nothing is available. A poisoned capdata device releases or skips allocating most resources, e.g., the capability data list and the debugfs directory. The device itself is only used to satisfy the component dependency of lenovo-wmi- other and coordinate with the latter about the absence of the capability data. Reported-by: Charles Link: https://msgid.link/CAKtz0s8UYRQYW_0bh=3D0TMx47Axm-W-muEay-r3rqUBS1NHM= PVw@mail.gmail.com/ Signed-off-by: Rong Zhang Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 71 +++++++++++++++++++++++++++= ++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index 5e66e6b52720..d4d5e8c97ddb 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +47,7 @@ #include #include #include +#include #include #include =20 @@ -447,7 +450,7 @@ static const struct component_ops lwmi_cd_sub_component= _ops =3D { /* * lwmi_cd*_get_data - Get the data of the specified attribute * @list: The lenovo-wmi-capdata pointer to its cd_list struct. - * @attribute_id: The capdata attribute ID to be found. + * @attribute_id: The capdata attribute ID (non-zero) to be found. * @output: Pointer to a capdata* struct to return the data. * * Retrieves the capability data struct pointer for the given @@ -460,7 +463,7 @@ static const struct component_ops lwmi_cd_sub_component= _ops =3D { { \ u8 idx; \ \ - if (WARN_ON(!list)) \ + if (WARN_ON(!list || !attribute_id)) \ return -EINVAL; \ \ guard(mutex)(&list->list_mutex); \ @@ -595,6 +598,66 @@ static void lwmi_cd_debugfs_remove(struct lwmi_cd_priv= *priv) =20 /* =3D=3D=3D=3D=3D=3D=3D=3D WMI interface =3D=3D=3D=3D=3D=3D=3D=3D */ =20 +/** + * lwmi_cd_poison() - Poison the device by not providing any capability da= ta + * @priv: lenovo-wmi-capdata driver data. + * @err: The occurred error. + * + * The Other Mode driver binds to both Capability Data 00 and 01. If eithe= r 00 + * or 01 fails to probe, the Other Mode device will fail to provide fw-att= r or + * hwmon device for the other functional capdata device. + * + * Therefore, WMI errors must be non-fatal in order not to break the assum= ptions + * made by the device component famrework, so that the Other Mode device c= an + * provide whatever is functional. + * + * After poisoning the device, NULL list will be passed to the Other Mode = device + * on bind. + * + * Return: 0 if the @err is suppressed, otherwise its propagated as is. + */ +static int lwmi_cd_poison(struct lwmi_cd_priv *priv, int err) +{ + dev_warn(&priv->wdev->dev, "%s %s (%u items) due to error: %d\n", + priv->initialized ? "clearing" : "poisoning", priv->info->name, + priv->list ? priv->list->count : 0, err); + + /* Simply print the warning message. */ + if (!priv->list) + return priv->initialized ? err : 0; + + /* Poison the device on initialization errors. */ + if (!priv->initialized) { + devm_kfree(&priv->wdev->dev, priv->list); + priv->list =3D NULL; + + return 0; + } + + /* + * Runtime errors are transient. Simply clear all cached data and + * propagate the error. + * + * Since a valid attribute id is never 0 (the firmware also untilize the + * fact to stub some capabilities according to platform metadata), + * clearing the cached data effectively makes all attributes temporarily + * unavailable until the next notifier call. + */ + + lockdep_assert_held(&priv->list->list_mutex); + + switch (priv->info->type) { + case LENOVO_CAPABILITY_DATA_01: + memset(priv->list->cd01, 0, + flex_array_size(priv->list, cd01, priv->list->count)); + break; + default: + unreachable(); + } + + return err; +} + /** * __lwmi_cd_cache() - Cache all WMI data block information locklessly * @priv: lenovo-wmi-capdata driver data. @@ -633,7 +696,7 @@ static int __lwmi_cd_cache(struct lwmi_cd_priv *priv) if (ret =3D=3D -ENODATA) /* The block is too short, probably stubbed. */ continue; if (ret) - return ret; + return lwmi_cd_poison(priv, ret); =20 /* Capdata 01 is an extension to capdata 00. */ struct capdata00 *capdata __free(kfree) =3D wbuf.data; @@ -693,7 +756,7 @@ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_= priv *priv) if (ret =3D=3D -ENODATA) /* The block is too short, probably stubbed. */ return 0; if (ret) - return ret; + return lwmi_cd_poison(priv, ret); /* Print the warning message. */ =20 struct cd_fan_block *block __free(kfree) =3D wbuf.data; =20 --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender6-op-o15.zoho.com (sender6-op-o15.zoho.com [165.173.180.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EC4F369D7C; Sun, 13 Sep 2026 20:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.180.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332697; cv=pass; b=azy39i+8N/2tVzywI7HtV7BS3jM4v6GOBZfAfoYipYGeBugYSAEeWDO4V3n9jOdYU+dknH0lCmnTSA6vp07kc84MWhTAroGKcOdZQ3tGJeXPBGDwyFsNrk7GLlTATSdDhBgRoMNyqfCTtXunB/EIGrLQ8Hdz1Ywycluy9XeCrMk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332697; c=relaxed/simple; bh=1cxWUIl3gEBMBYtY6zbUEKh6sjmVvjyj56/yOY20qC8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oMbEQP911B6G/a7QKvXOlSf/B228KecDdWVUsvVTtssiZIawjoyeNK/oqapPpzBy33wYmpjMtvxvR7UbLTij7GrG9ufDVZR1HXMnhkJfkqvPnEhveu6+tcj1SdnUXnE9Hl2fSkSGaWaZNzUkvfTqjY7aCZUIZM8xNk/O9oKkFjk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=V8FzNDjB; arc=pass smtp.client-ip=165.173.180.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="V8FzNDjB" ARC-Seal: i=1; a=rsa-sha256; t=1789332648; cv=none; d=zohomail.com; s=zohoarc; b=lUBFkPgQqQNE+fWlfvpyns1CImTm9LLvjmdz5o36GUE7b0+FP6ZGfrJPU2Wwn+/B8Rxf4HHOL4yWXEeywSGK7XK/6oqg2ss/M2L+Q1w11avoWuGdvg0dS0YhyIUONBsy8smOlXUMTkVnNmmCepG+gXak8VFI3B1cBNmxoByiZGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332648; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=WoM0RDYPbOOrHvqbcNM+hqNOrg7RITsWO+B3vvVx5dQ=; b=Qv64qe+FarsMjqKxYwMcOgdHxrohu8TyIVkPa5yQiOc1abrQoXmRbhTLWN40rJmwg87fPHdkA5eQglLjz8siqScxifY6eXepVue6qXcVqbiYMJ21nSgBY6BCLFVOgfBI9a2+12ETaNfB9TERtvCyBYOGt+Bet4mZ9eQS5HaMk9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332648; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=WoM0RDYPbOOrHvqbcNM+hqNOrg7RITsWO+B3vvVx5dQ=; b=V8FzNDjBmtJGWAJi6PPLpNuBUh3M0LyPEZc+IWjUhhmIZl5taWcds+mVlxXN6dK8 H0OilSRWwfc21DKy203+8jkc2M/bbjiFkuyC6pO+czdHvSRxi4ER9uGeaUzaSrxOjVL KVC5tx/n282jhkuRSSwmSha9BaIgRZ64+Qgf+jBBAFAgUvFSK/Uot/fsbyqU0y9i3nY IsG1KEMWJIlEvXKzfbv6unh+QnBDDVw9OEHOV+7MaLBCiz0uStOWalkgYRcfhheTC4i 7T/yTbuvn73jO9J0HOD/Cp9TlVsfv/yLODvGB7ToufR81i6Wy+OYwb5NUwY+6/Avgk3 t154aBg/yA== Received: by smtp.zohomail.com with SMTPS id 1789332647952883.7879633296424; Sun, 13 Sep 2026 13:50:47 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:28 +0800 Subject: [PATCH 7/9] platform/x86: lenovo-wmi-capdata: Detect stubbed capdata device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-7-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External Some devices may stub the capdata device's WMI query method because it doesn't support the relevant interfaces at all. For example, most ThinkBook devices doesn't support GameZone or Other Mode thermal tuning, so capdata 01 is useless and stubbed. Keeping the capability data list with empty data is meaningless and causes lenovo-wmi-other to call lwmi_cd*_get_data() to retrieve nonexistent capdata in vain. Therefore, poison the device and release (or skip allocating) needless resources, e.g., the capability data list and the debugfs directory. Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-capdata.c | 33 +++++++++++++++++++++++++++= ++++ 1 file changed, 33 insertions(+) diff --git a/drivers/platform/x86/lenovo/wmi-capdata.c b/drivers/platform/x= 86/lenovo/wmi-capdata.c index d4d5e8c97ddb..805e36ef7f31 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.c +++ b/drivers/platform/x86/lenovo/wmi-capdata.c @@ -668,6 +668,7 @@ static int lwmi_cd_poison(struct lwmi_cd_priv *priv, in= t err) */ static int __lwmi_cd_cache(struct lwmi_cd_priv *priv) { + bool got_data =3D false; size_t size; int idx; void *p; @@ -702,8 +703,31 @@ static int __lwmi_cd_cache(struct lwmi_cd_priv *priv) struct capdata00 *capdata __free(kfree) =3D wbuf.data; =20 memcpy(p, capdata, size); + + /* + * A valid attribute always has a non-zero id. IOW, a zero id + * implies a stubbed item (or the query method being stubbed). + * + * The stubbed item is still copied to the cache slot anyway, in + * case the firmware dynamically stubs the capdata item after + * switching Game Zone mode. In this manner, the previously + * exposed capdata can be void. + */ + if (capdata->id) + got_data =3D true; } =20 + /* + * Some devices may stub the query method because it doesn't support the + * relevant interfaces at all. For example, most ThinkBook devices + * doesn't support Game Zone or Other Mode thermal tuning, so capdata 01 + * is useless and stubbed. + * + * Poison the device and release needless resources. + */ + if (!got_data) + return lwmi_cd_poison(priv, -ENODATA); + return 0; } =20 @@ -743,6 +767,7 @@ static int lwmi_cd_cache(struct lwmi_cd_priv *priv) static int lwmi_cd_fan_list_alloc_cache(struct lwmi_cd_priv *priv) { struct wmi_buffer wbuf; + bool got_data =3D false; struct cd_list *list; int ret, idx; u32 count; @@ -785,14 +810,22 @@ static int lwmi_cd_fan_list_alloc_cache(struct lwmi_c= d_priv *priv) priv->list =3D list; =20 for (idx =3D 0; idx < count; idx++) { + if (!block->data[idx]) /* Ignore stub. */ + continue; + /* Do not calculate array index using count, as it may be truncated. */ list->cd_fan[idx] =3D (struct capdata_fan) { .id =3D block->data[idx], .max_rpm =3D block->data[idx + block->nr], .min_rpm =3D block->data[idx + (2 * block->nr)], }; + + got_data =3D true; } =20 + if (!got_data) + return lwmi_cd_poison(priv, -ENODATA); + return 0; } =20 --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender5-op-o15.zoho.com (sender5-op-o15.zoho.com [165.173.182.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A192537F8CB; Sun, 13 Sep 2026 20:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.182.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332706; cv=pass; b=WmwQq1nVLLmHP+s1iVLR/6HKzkUzujlqsGXTgscPJsjrOUXYqI2QSTUihPQ/pZOfstSUNWd3UET7m/joAgER3KS8tyeU7MG51z+BHM27cC2oS5IZyHlUgQjPnt/wDzriDkBu6XMqtSSJSvQ4P6H+sElFEj6aEc1+41STxg+H2gQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332706; c=relaxed/simple; bh=ZOeGXeEkAkv34jClDSEtnI3oR0m4n7d53FJjNZiwUI4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uPFJBCmskk4auzIJr/zVSnuqwonqrlpp2EdZEbhY2Y4t1X6Sq73vjELSh+ElW9iyYaT5hNY8juOyM/YrabfV1aUXYrrlYQltQTxrRzPnV1N9Vv6UDJyTLG9jjCnUFJGIuhVecMXQm+h+dF7SEsIAYqn+gv+Wxx17hVdcqH/EzNU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=e68vnmeu; arc=pass smtp.client-ip=165.173.182.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="e68vnmeu" ARC-Seal: i=1; a=rsa-sha256; t=1789332652; cv=none; d=zohomail.com; s=zohoarc; b=JE7X5bBKRDayLIG8Z7EMfZEpKzkIR1nxn+zqoc63gO/R1n/SiphgaMeQUV5zUASCyZg2h/trtn/+n+zq0nSFf70nWE+HlsvP1gtA2bTIh6e+lhnyrLnP2QxGaEHm4Kd4gkfOILOKt7fUb1ATwiz7S03cZ0iiASrdhM59OXbp+Ao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332652; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=HvRz4woefoDbgxNylMP+yqczp1WJkIWrl7x5Gi/BnVw=; b=CCSGJl5akUgRYbEDemGNUQGI3o72Rjy8LRNxUg0s4qYw9MOmQ7vgSk8ceSATVaotfzGbDG6XPTn2Wqy3o1PxEcn318I9CpF8+PsKudq3v0rYeAfYkeMbCS7jHb1yw7k8lFPjQqPQLVbg2xIaga9AQ6VrAP8ZV8ERk/S4K0Vk/+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332652; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=HvRz4woefoDbgxNylMP+yqczp1WJkIWrl7x5Gi/BnVw=; b=e68vnmeu0zJHMp50cGYLlN7HskUfWACoZspIIILuT4r+uQ2E77gyLkcd8VZOHBSN 7JSQ5xFcIPC7lglEUa6SaLQx6C5eEqMrptJX5WI/sxd3fwTZm8TPnOnS8UliygliTm2 SE9RPJrBH3v+JHc4NnDKXnN2tDYsE5V+Yi9FGz51w9HpOxTlBEXYAum77X6rZgGJ6dq gskOOwYbxJHR3M744Esyz9xPi3I6CdNhl9ShSFjQKEy7sFgg33gNsK4odmMUh15yTzc pJO1OnWR2t5koHRWwB9jnow16V+8Hv3EHk7979lwNzsHnts07b9iF15UNu20nhbJnZJ 3+qR90PZBA== Received: by smtp.zohomail.com with SMTPS id 1789332650602879.5848041182492; Sun, 13 Sep 2026 13:50:50 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:29 +0800 Subject: [PATCH 8/9] platform/x86: lenovo-wmi-helpers: Adopt new WMI API Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-8-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External The new WMI API supports multiple ACPI types by converting them into a unified buffer that satisfies alignment and size requirements. Adopt it to make our life easier. Note that the Windows WMI-ACPI driver converts all ACPI objects into a common buffer format, so adopting the new API intentionally accepts more ACPI types as a followup of commit 465dc9da8ff6 ("platform/x86: lenovo-wmi-helpers: Convert returned buffer into u32"). Suggested-by: Armin Wolf Link: https://lore.kernel.org/r/f1787927-b655-4321-b9d9-bc12353c72db@gmx.de/ Signed-off-by: Rong Zhang Reported-by: Charles Suggested-by: Derek J. Clark --- drivers/platform/x86/lenovo/wmi-helpers.c | 61 ++++++++++++---------------= ---- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/drivers/platform/x86/lenovo/wmi-helpers.c b/drivers/platform/x= 86/lenovo/wmi-helpers.c index 8f5766c391eb..687caa226263 100644 --- a/drivers/platform/x86/lenovo/wmi-helpers.c +++ b/drivers/platform/x86/lenovo/wmi-helpers.c @@ -24,9 +24,10 @@ #include #include #include -#include #include =20 +#include + #include "wmi-helpers.h" =20 /* Thermal mode notifier chain. */ @@ -42,49 +43,33 @@ static BLOCKING_NOTIFIER_HEAD(tm_chain_head); * @size: Length of the buffer. * @retval: Pointer for the return value to be assigned. * - * Calls wmidev_evaluate_method for Lenovo WMI devices that return an ACPI - * integer. Validates the return value type and assigns the value to the - * retval pointer. + * Calls the specified WMI method for Lenovo WMI devices that return a WMI + * integer. Validates the return value and assigns it to @retval when it's= not + * NULL, otherwise the return value is not validated. * * Return: 0 on success, or an error code. */ int lwmi_dev_evaluate_int(struct wmi_device *wdev, u8 instance, u32 method= _id, unsigned char *buf, size_t size, u32 *retval) { - struct acpi_buffer output =3D { ACPI_ALLOCATE_BUFFER, NULL }; - struct acpi_buffer input =3D { size, buf }; - acpi_status status; - - status =3D wmidev_evaluate_method(wdev, instance, method_id, &input, - &output); - if (ACPI_FAILURE(status)) - return -EIO; - - union acpi_object *ret_obj __free(kfree) =3D output.pointer; - - if (retval) { - if (!ret_obj) - return -ENODATA; - - switch (ret_obj->type) { - /* - * The ACPI method may simply return a buffer when a u32 - * is expected. This is valid on Windows as its WMI-ACPI - * driver converts everything to a common buffer. - */ - case ACPI_TYPE_BUFFER: - if (ret_obj->buffer.length < sizeof(u32)) - return -ENXIO; - - *retval =3D get_unaligned_le32(ret_obj->buffer.pointer); - return 0; - case ACPI_TYPE_INTEGER: - *retval =3D (u32)ret_obj->integer.value; - return 0; - default: - return -ENXIO; - } - } + struct wmi_buffer input =3D { + .length =3D size, + .data =3D buf, + }; + struct wmi_buffer output; + int ret; + + if (!retval) + return wmidev_invoke_procedure(wdev, instance, method_id, &input); + + ret =3D wmidev_invoke_method(wdev, instance, method_id, &input, + &output, sizeof(__le32)); + if (ret) + return ret; + + __le32 *valp __free(kfree) =3D output.data; + + *retval =3D le32_to_cpu(*valp); =20 return 0; }; --=20 2.55.0 From nobody Fri Sep 25 11:08:08 2026 Received: from sender6-op-o15.zoho.com (sender6-op-o15.zoho.com [165.173.180.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BCF63783B4; Sun, 13 Sep 2026 20:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=165.173.180.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332713; cv=pass; b=ZWQrnbxGjnr9moWWrW6xqgye0quejNgp4wqjrImSB9zHdJ27UOhzOo+iKiArrjvsO3aXB1qed1H7sReUPWrFP8VhR/c4XgAIGHEGt5XjTz3LZajwBoZsWm8sNhQ2HbLv3rbWrJni7rq+QpFj7buYjFSuVGTtnku90uh645ur3tM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789332713; c=relaxed/simple; bh=LTvCzRp12oClqrWsnpeiVMNof0cHXe4KvDJEs3CMNjE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lAgVqKM51BcBuxjy8ksWX3KESIGY/rVQw57RJXVmjkKTwR3e9jXaQ6ybf7xI6auyXbeBieuN4ZrWWzkfMJsxXhRY0zDNgVeaLumupUEJbiofNmJRzXlW9k3ndkT4wSFlCaV9ThldkQJ2u81NlOZQOoPl8lSfJLi8W7xGYjthaQA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe; spf=pass smtp.mailfrom=rong.moe; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b=oOgaCkVm; arc=pass smtp.client-ip=165.173.180.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rong.moe Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rong.moe Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rong.moe header.i=i@rong.moe header.b="oOgaCkVm" ARC-Seal: i=1; a=rsa-sha256; t=1789332654; cv=none; d=zohomail.com; s=zohoarc; b=mUxibGHOgRBGjz8kzT3K1fi6qnvQBLLSpH1gbf6RP4THSgrj9GYPgOAxatvt8WYivEjIHh8zOv0ZgcGdwLsF45bkpb3FVGapOY4GpFxuVQslp0UiuU6TWX2hl8b1ckXHVKStAjLz2J+UZnF4mkpknCGkkPVaP4sWK+TgjBAXNUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789332654; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=/9RGclajS9AMvJ5UjvGYP7NKToYvyMliQF8dgJQOqjA=; b=FFwQKvskozk+b/B3B0hniignuVnObl5vx6+ysGH0ql8MWt56P0vli+N6uBlWie/9upqn3MJ/ljcn1FJhufyd2okvyCW8P4N7P5r0YLO0xpRD6vtkyKXxNVkwndTXolwyNyWcpQpSokYSz80oXMLfzyuJSqCyMDxY+bqVAmy+TVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rong.moe; spf=pass smtp.mailfrom=i@rong.moe; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789332654; s=zmail2048; d=rong.moe; i=i@rong.moe; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=/9RGclajS9AMvJ5UjvGYP7NKToYvyMliQF8dgJQOqjA=; b=oOgaCkVmveTKmpTj9wXZsrzKCjI0EYdvxObNMvycoFx5sMLNE8UjCxRppN1rIyA6 dkkuzriHfjTerjV2caU5cCvWPJhkirMrxVYKBg3Z/CBkTwOW7LifQk15TeAKSZxkMP8 +gwG7KRGd1M3gor1l0ECzMBxi8yANWXVDFdrOsxALG726naBrCMVntKPaeFPedtSXl3 yqHFE0wX8afUDcYUYYMB7LzaZvSt1Z2gzbVY1qGDXQqVgQ86vYCIkxp+vVWL7dBm7OI GFaVz1Qz7dZVrGSM3cWitvlsoZ3S2SN5vzGhsRHqPWPo0IRZ1PJIY8DpKkuzgEZhvrV +UyiTH+Fnw== Received: by smtp.zohomail.com with SMTPS id 1789332653249314.3828254721873; Sun, 13 Sep 2026 13:50:53 -0700 (PDT) From: Rong Zhang Date: Mon, 14 Sep 2026 04:50:30 +0800 Subject: [PATCH 9/9] platform/x86: Add myself as LENOVO drivers maintainer Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-lwmi-wmi-new-api-v1-9-7a400f2f69f8@rong.moe> References: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> In-Reply-To: <20260914-lwmi-wmi-new-api-v1-0-7a400f2f69f8@rong.moe> To: Mark Pearson , "Derek J. Clark" , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Armin Wolf Cc: Charles , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Rong Zhang X-Mailer: b4 0.17-dev-1f2f7 X-ZohoMailClient: External I regularly improve LENOVO drivers (including lenovo-wmi-* and ideapad-laptop) and review patches posted on the pdx86 mailing list along with Derek J. Clark. Add myself as a LENOVO drivers maintainer to reflect this. Suggested-by: Derek J. Clark Link: https://msgid.link/782FE636-A06A-4E12-9563-786374805947@gmail.com Signed-off-by: Rong Zhang Reported-by: Charles --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c2414447892c..d69be560ee98 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14805,6 +14805,7 @@ F: drivers/usb/misc/legousbtower.c LENOVO drivers M: Mark Pearson M: Derek J. Clark +M: Rong Zhang L: platform-driver-x86@vger.kernel.org S: Maintained F: Documentation/wmi/devices/lenovo-wmi-gamezone.rst --=20 2.55.0