From: James Seo <james@equiv.tech>
To: Lukasz Stelmach <l.stelmach@samsung.com>
Cc: Guenter Roeck <linux@roeck-us.net>, Armin Wolf <W_Armin@gmx.de>,
linux-hwmon@vger.kernel.org
Subject: Re: [BUG] hp-wmi-sensors: probe of 8F1F6435-9F42-42C8-BADC-0E9424F20C9A failed with error -22
Date: Tue, 31 Oct 2023 07:00:16 -0700 [thread overview]
Message-ID: <ZUEIcOBpVzxC/+c1@equiv.tech> (raw)
In-Reply-To: <oypijd5y2nf60f.fsf%l.stelmach@samsung.com>
On Tue, Oct 31, 2023 at 11:20:00AM +0100, Lukasz Stelmach wrote:
> I am attaching dsdt.dat. It is the only file that contains the
> "HPBIOS_BIOSEvent" string and the above UUID.
OK, I think I've figured it out.
Earlier, I focused on "probe of 8F1F6435-9F42-42C8-BADC-0E9424F20C9A failed"
(the GUID of HPBIOS_BIOSNumericSensor), and missed it when you said the failure
is happening when check_wobj() is called from check_platform_events_wobj().
So the issue is actually with HPBIOS_PlatformEvents.Name, since any instances
of that WMI object are examined during driver init as well.
After using iasl to decompile the DSDT you sent to ACPI Source Language (ASL),
everything looks fine with HPBIOS_BIOSNumericSensor. Not that I'm particularly
familiar with ASL, but search for "Name (SEN1, Package (0x06)" and read on to
the "Method (_INI, 0, NotSerialized)" and the "Method (WQAE, 1, Serialized)"
lines below. It certainly looks like that's how the BIOS on that system is
generating HPBIOS_PlatformEvents instances at runtime.
For HPBIOS_PlatformEvents instances, that BIOS seems to generate them in two
places. The driver is interested in those from "Method (WQBC, 1, Serialized)",
which rely on the section above that beginning at "Name (EVNT, Package (0x0D)".
There are also some generated in "Method (WQPE, 1, Serialized)", relying on:
Name (CBWE, Package (0x02)
{
Package (0x05)
{
Unicode ("4BIOS Configuration Change"), // Oops.
"BIOS Settings",
0x04,
0x05,
0x02
},
Package (0x05)
{
"BIOS Configuration Security",
"An attempt has been made to Access BIOS features unsuccessfully",
0x04,
0x0A,
0x06
}
})
So yes, Armin was right, UTF-16 is the culprit. And it's only for this one
instance of HPBIOS_PlatformEvents on this one system's BIOS.
Can you find the wonky object instance in the debugfs interface? I imagine
its name shows up as either "4" or an empty string, depending on the UTF-16
byte order.
I'm also curious how it looks in Windows (I used WMI Explorer [1] during
development). The WMI namespace should be "\\.\root\HP\InstrumentedBIOS".
> The readings of hp_wmi_sensors-virtual-0 look sensible and they change
> reasonably under load.
Good. I guess that part working wasn't so surprising after all :)
Regarding how we proceed from here, I think the main question is whether a
workaround should be limited to only specific machines (maybe detected using
DMI data), and if so, to specific WMI object types and instances (cf.
hp_wmi_get_wobj(), though limiting on instance number would be fragile if
BIOS updates change instance numbering). Other questions are how thoroughly
to validate UTF-16 in a buffer and whether to convert to UTF-8 internally.
For what it's worth, I personally don't see much value in doing much more than
a machine-limited workaround for now. To me it's clear that this UTF-16 corner
case is a BIOS bug and its consequences are minimal once a workaround is in
place.
Thoughts? Also, if you'd prefer to let me handle it, I'd be glad to write a
patch myself.
[1] https://github.com/vinaypamnani/wmie2
next prev parent reply other threads:[~2023-10-31 14:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20231113115327eucas1p11f84e775ce78deaa01557f3868c2f9dd@eucas1p1.samsung.com>
2023-10-27 15:07 ` [BUG] hp-wmi-sensors: probe of 8F1F6435-9F42-42C8-BADC-0E9424F20C9A failed with error -22 Lukasz Stelmach
2023-10-27 17:07 ` Guenter Roeck
2023-10-27 18:50 ` Armin Wolf
2023-10-28 18:37 ` James Seo
2023-10-31 12:05 ` Lukasz Stelmach
2023-10-31 14:00 ` James Seo [this message]
2023-10-31 14:16 ` James Seo
2023-10-31 14:47 ` Guenter Roeck
2023-10-31 19:07 ` Lukasz Stelmach
2023-10-31 19:28 ` Guenter Roeck
2023-10-31 21:07 ` Lukasz Stelmach
2023-10-31 22:34 ` Armin Wolf
2023-11-01 4:34 ` James Seo
2023-11-02 1:11 ` Armin Wolf
2023-11-02 5:11 ` James Seo
2023-11-01 5:52 ` James Seo
2023-11-02 8:15 ` Lukasz Stelmach
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=ZUEIcOBpVzxC/+c1@equiv.tech \
--to=james@equiv.tech \
--cc=W_Armin@gmx.de \
--cc=l.stelmach@samsung.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/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.