From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Rong Zhang" <i@rong.moe>,
"Derek J . Clark" <derekjohn.clark@gmail.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Alok Tiwari" <alok.a.tiwari@oracle.com>,
"Armin Wolf" <W_Armin@gmx.de>
Cc: "platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] platform/x86: lenovo-wmi-other: Refine firmware_attributes interface
Date: Wed, 18 Nov 2026 17:19:03 -0500 [thread overview]
Message-ID: <8d411491-3b83-4399-8a6b-1afa18cb0d4d@app.fastmail.com> (raw)
In-Reply-To: <20261119-lwmi-no-singleton-v1-0-6b06fcfb5126@rong.moe>
Hi Rong,
On Wed, Nov 18, 2026, at 1:58 PM, Rong Zhang wrote:
> The driver declares `.no_singleton = true' but stores device-specific
> data to statically allocated tunable_attr_01 variables. This makes the
> driver depend on the frigile fact that no device in wild has more than
minor typo: frigile/fragile
> one LENOVO_OTHER_MODE WMI devices.
>
> The series moves tunable_attr_01.device to the firmware_attributes
> device's drvdata and introcdces a tunable_attr_01_ctx array to struct
minor typo: introcdeces/introduces
> to store c[dv]_mode_id. In this manner, all statically allocated
> variables relevant to our firmware_attributes interface are constified.
>
> This also eliminates all attribute-specific callbacks by moving their
> data into a newly-introduced container struct capdata01_attr, so that
> all remaining attribute callbacks becomes generic and are shared among
> different attributes, which shrinks the module size by 42.7%.
>
> To further follow the common practice of sysfs attributes, all attribute
> groups are now created and removed at once using sysfs_create_groups()
> and sysfs_remove_groups() by providing an is_visible() callback.
>
> Signed-off-by: Rong Zhang <i@rong.moe>
> ---
> Rong Zhang (5):
> platform/x86: lenovo-wmi-other: Retrieve private data from
> firmware_attributes device
> platform/x86: lenovo-wmi-other: Eliminate attribute-specific
> callbacks
> platform/x86: lenovo-wmi-other: Factor out tunable_attr_01
> definition into a macro
> platform/x86: lenovo-wmi-other: Properly implement no_singleton
> driver
> platform/x86: lenovo-wmi-other: Hide unsupported attributes using
> is_visible() callback
>
> drivers/platform/x86/lenovo/wmi-other.c | 566 +++++++++++++++-----------------
> 1 file changed, 259 insertions(+), 307 deletions(-)
> ---
> base-commit: 20eef29b7c8465ac98d7dd6d6f2ac07a8d8056ca
> change-id: 2c0ec814-lwmi-no-singleton-a3f945179a50
>
> Thanks,
> Rong
prev parent reply other threads:[~2026-11-18 22:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 18:58 Rong Zhang
2026-11-18 18:58 ` [PATCH 1/5] platform/x86: lenovo-wmi-other: Retrieve private data from firmware_attributes device Rong Zhang
2026-11-18 22:19 ` Mark Pearson
2026-11-18 18:58 ` [PATCH 2/5] platform/x86: lenovo-wmi-other: Eliminate attribute-specific callbacks Rong Zhang
2026-11-18 22:17 ` Mark Pearson
2026-11-18 18:58 ` [PATCH 3/5] platform/x86: lenovo-wmi-other: Factor out tunable_attr_01 definition into a macro Rong Zhang
2026-11-18 22:19 ` Mark Pearson
2026-11-18 18:58 ` [PATCH 4/5] platform/x86: lenovo-wmi-other: Properly implement no_singleton driver Rong Zhang
2026-11-18 22:27 ` Mark Pearson
2026-11-18 18:58 ` [PATCH 5/5] platform/x86: lenovo-wmi-other: Hide unsupported attributes using is_visible() callback Rong Zhang
2026-11-18 22:23 ` Mark Pearson
2026-11-18 22:19 ` Mark Pearson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d411491-3b83-4399-8a6b-1afa18cb0d4d@app.fastmail.com \
--to=mpearson-lenovo@squebb.ca \
--cc=W_Armin@gmx.de \
--cc=alok.a.tiwari@oracle.com \
--cc=derekjohn.clark@gmail.com \
--cc=hansg@kernel.org \
--cc=i@rong.moe \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®