All of lore.kernel.org
 help / color / mirror / Atom feed
* Report: lenovo_wmi_other FW attributes always read 0
@ 2026-02-04  8:00 Kurt Borja
  2026-02-04  8:36 ` Derek J. Clark
  0 siblings, 1 reply; 13+ messages in thread
From: Kurt Borja @ 2026-02-04  8:00 UTC (permalink / raw)
  To: Derek J. Clark, Rong Zhang, Ilpo Järvinen, Armin Wolf,
	Mark Pearson
  Cc: platform-driver-x86

Hi all,

In my system (83KY Legion 7 16IAX1) the current_value of any of the
firmware attributes exposed by this driver always reads 0

	$ ls /sys/class/firmware-attributes/lenovo-wmi-other-0/attributes/
	ppt_pl1_spl  ppt_pl2_sppt  ppt_pl3_fppt

	$ cat /sys/class/firmware-attributes/lenovo-wmi-other-0/attributes/*/current_value
	0
	0
	0

After investigating my acpidump [1] I found that the argument passed to
the WMI method Arg2 is matched as a whole integer instead of individual
bytes (L: 49203)

	If ((ToInteger (Arg2) == 0x01010000))
	{
		Return (^^PC00.LPCB.EC0.F5E0) /* \_SB_.PC00.LPCB.EC0_.F5E0 */
	}

	If ((ToInteger (Arg2) == 0x01020000))
	{
		Return (^^PC00.LPCB.EC0.CCP1) /* \_SB_.PC00.LPCB.EC0_.CCP1 */
	}

	If ((ToInteger (Arg2) == 0x01030000))
	{
		/* This case (CPU FPPT) is actually just zero... */
		Return (Zero)
	}

...and the driver always sets the second byte of Arg2 to the current
profile (mode), which is never zero!

	attribute_id =
		FIELD_PREP(LWMI_ATTR_DEV_ID_MASK, tunable_attr->device_id) |
		FIELD_PREP(LWMI_ATTR_FEAT_ID_MASK, tunable_attr->feature_id) |
	-->	FIELD_PREP(LWMI_ATTR_MODE_ID_MASK, mode) |
		FIELD_PREP(LWMI_ATTR_TYPE_ID_MASK, tunable_attr->type_id);

So it never actually matches the attribute and falls back to zero :/

This is however, not the case for all tunables. As you can see in the
acpidump, just bellow the block above, these are matched depending on
the current mode (second byte)


	If ((ToInteger (Arg2) == 0x01080100))
	{
		...
	}

	If ((ToInteger (Arg2) == 0x01080200))
	{
		...
	}

	If ((ToInteger (Arg2) == 0x01080300))
	{
		...
	}

	If ((ToInteger (Arg2) == 0x0108FF00))
	{
		...
	}

The fix should be easy for this device but I don't know how other
compatible models handle this argument. Hopefully we can find a solution
that works for everyone?

Thanks for looking into it!

[1] https://lore.kernel.org/platform-driver-x86/DFPEEI5LNJXZ.2E32AHA8VUJW3@gmail.com/2-acpidump.txt

-- 
Thanks,
 ~ Kurt

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-02-17 14:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-04  8:00 Report: lenovo_wmi_other FW attributes always read 0 Kurt Borja
2026-02-04  8:36 ` Derek J. Clark
2026-02-04 16:43   ` Kurt Borja
2026-02-04 17:45     ` Derek J. Clark
2026-02-04 23:33       ` Kurt Borja
2026-02-05  0:04         ` Derek John Clark
2026-02-05  3:13           ` Derek John Clark
2026-02-05 17:40             ` Kurt Borja
2026-02-06  7:11               ` Derek John Clark
2026-02-06 18:01                 ` Rong Zhang
2026-02-06 23:31                   ` Derek J. Clark
2026-02-17 14:07                     ` Rong Zhang
2026-02-10 23:38                 ` Kurt Borja

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.