All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Rong Zhang <i@rong.moe>
Cc: "Derek J. Clark" <derekjohn.clark@gmail.com>,
	 Mark Pearson <mpearson-lenovo@squebb.ca>,
	Armin Wolf <W_Armin@gmx.de>,  Hans de Goede <hansg@kernel.org>,
	Charles <hanker007@gmail.com>,
	 "platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	 Navon John Lukose <navonjohnlukose@gmail.com>
Subject: Re: [PATCH 0/9] platform/x86: lenovo-wmi-{other,capdata,helpers}: Improve robustness on buggy firmware
Date: Thu, 8 Oct 2026 14:47:01 +0300 (EEST)	[thread overview]
Message-ID: <65e44beb-740a-8d41-9e3e-2ef1fa6cd6f1@linux.intel.com> (raw)
In-Reply-To: <372185f86fc1f5fbeddde42b1378a5d454f91e60.camel@rong.moe>

[-- Attachment #1: Type: text/plain, Size: 6275 bytes --]

On Thu, 8 Oct 2026, Rong Zhang wrote:

> Hi Ilpo,
> 
> On Wed, 2026-10-07 at 23:54 +0300, Ilpo Järvinen wrote:
> > On Wed, 7 Oct 2026, Derek J. Clark wrote:
> > 
> > > On October 7, 2026 11:30:00 AM PDT, Rong Zhang <i@rong.moe> wrote:
> > > > Hi Mark, Armin,
> > > > 
> > > > 于 2026年9月29日 GMT+08:00 01:53:18,Rong Zhang <i@rong.moe> 写道:
> > > > > Hi Mark, 
> > > > > 
> > > > > Thanks for the information. 
> > > > > 
> > > > > 于 2026年9月29日 GMT+08:00 00:04:14,Mark Pearson <mpearson-lenovo@squebb.ca> 写道:
> > > > > > 
> > > > > > 
> > > > > > 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@gmail.com> 写道:
> > > > > > > > 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
> > > > 
> > > > So there is no way to determine the existence of capdata01 using capdata00, correct?
> > > > 
> > > > > > 
> > > > > > 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?
> > > > > 
> > > > > After some consideration, it seems that we don't really need to determine the existence of capdata01 if we take the sub-component approach, thanks to the fact that every functionality either depends on capdata00 or depends on capdata01, but never both.
> > > > 
> > > > Unfortunately, it turned out that it can't resolve the issue by simply converting capdata01 into a sub-component, unless a virtual device is also created to split the component matching list into two, which is more like a dirty workaround.
> > > > 
> > > > So yeah, the series needs the wmidev_exists() patch from Armin. 
> > > > Considering that the ThinkLMI v2 series is probably still at the RFC 
> > > > stage, do you mind if I integrate the wmidev_exists() patch into my 
> > > > series? 
> > > 
> > > Rong/Mark,
> > > 
> > > My $0.02, I don't think it matters who sends it up. If Ilpo is okay with 
> > > it of course, both series should include it as a prerequisite 1/X and 
> > > whichever gets picked up first will get into next. Then that patch can 
> > > be omitted from the other series when it gets picked. That way both 
> > > series will build if you apply the mbox onto next until one is merged.
> > 
> > Hi,
> > 
> > For me it's fine either way:
> > 
> > 1) Have the same patch in both series.
> > 
> > 2) If we know for sure we need the API anyway, just add it as a standalone 
> > in advance.
> > 
> > I suppose 2 would be slightly simpler but it's up to you which way you 
> > prefer.
> > 
> > Lets not make things more complicated than they have to be. :-)
> 
> Thanks for you suggestion.
> 
> The v2 patch is almost ready, and I will submit it today or tomorrow. It
> will anyway depend on the wmidev_exists() patch to build, so I'd prefer
> 1.
> 
> Or we can combine 1 and 2 -- do a subset apply with the wmidev_exists()
> patch if it looks good but my v2 series has issues. Then Mark and I can
> rebase and resubmit.

I've no problem in taking only a part of series as needed, if you prefer 
that.

Armin had something to say about the interface but I suppose you saw that 
already.

-- 
 i.

  reply	other threads:[~2026-10-08 11:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-13 20:50 [PATCH 0/9] platform/x86: lenovo-wmi-{other,capdata,helpers}: Improve robustness on buggy firmware Rong Zhang
2026-09-13 20:50 ` [PATCH 1/9] platform/x86: lenovo-wmi-capdata: Only allocate sub-master info when necessary Rong Zhang
2026-09-13 20:50 ` [PATCH 2/9] platform/x86: lenovo-wmi-capdata: Store a pointer to component info Rong Zhang
2026-09-13 20:50 ` [PATCH 3/9] platform/x86: lenovo-wmi-capdata: Defer mutex initialization Rong Zhang
2026-10-05 16:25   ` Ilpo Järvinen
2026-10-07 18:11     ` Rong Zhang
2026-09-13 20:50 ` [PATCH 4/9] platform/x86: lenovo-wmi-{capdata,other}: Only allocate capdata list when necessary Rong Zhang
2026-10-05 16:28   ` Ilpo Järvinen
2026-09-13 20:50 ` [PATCH 5/9] platform/x86: lenovo-wmi-capdata: Adopt new WMI API Rong Zhang
2026-09-13 20:50 ` [PATCH 6/9] platform/x86: lenovo-wmi-capdata: Register component even on WMI error Rong Zhang
2026-10-05 16:36   ` Ilpo Järvinen
2026-09-13 20:50 ` [PATCH 7/9] platform/x86: lenovo-wmi-capdata: Detect stubbed capdata device Rong Zhang
2026-09-13 20:50 ` [PATCH 8/9] platform/x86: lenovo-wmi-helpers: Adopt new WMI API Rong Zhang
2026-09-13 20:50 ` [PATCH 9/9] platform/x86: Add myself as LENOVO drivers maintainer Rong Zhang
2026-09-26 21:04 ` [PATCH 0/9] platform/x86: lenovo-wmi-{other,capdata,helpers}: Improve robustness on buggy firmware Navon John Lukose
2026-09-27  3:01   ` Rong Zhang
2026-09-28 16:04     ` Mark Pearson
2026-09-28 17:53       ` Rong Zhang
2026-09-28 19:09         ` Navon John Lukose
2026-10-07 18:30         ` Rong Zhang
2026-10-07 19:25           ` Mark Pearson
2026-10-07 23:44             ` Armin Wolf
2026-10-07 20:37           ` Derek J. Clark
2026-10-07 20:54             ` Ilpo Järvinen
2026-10-08 11:38               ` Rong Zhang
2026-10-08 11:47                 ` Ilpo Järvinen [this message]
2026-10-08 14:01                   ` Mark Pearson

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=65e44beb-740a-8d41-9e3e-2ef1fa6cd6f1@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=W_Armin@gmx.de \
    --cc=derekjohn.clark@gmail.com \
    --cc=hanker007@gmail.com \
    --cc=hansg@kernel.org \
    --cc=i@rong.moe \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=navonjohnlukose@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.