From: James Seo <james@equiv.tech>
To: Armin Wolf <W_Armin@gmx.de>
Cc: Lukasz Stelmach <l.stelmach@samsung.com>,
Guenter Roeck <linux@roeck-us.net>,
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 21:34:26 -0700 [thread overview]
Message-ID: <ZUHVUkzDfPX16+7P@equiv.tech> (raw)
In-Reply-To: <217211fb-ac5c-4b61-911d-4d25b90cddda@gmx.de>
On Tue, Oct 31, 2023 at 11:34:16PM +0100, Armin Wolf wrote:
> Am 31.10.23 um 22:07 schrieb Lukasz Stelmach:
>
>> It was <2023-10-31 wto 12:28>, when Guenter Roeck wrote:
>>> On 10/31/23 12:07, Lukasz Stelmach wrote:
>>>
>>> [ ... ]
>>>
>>>>> 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?
>
> I think this is no BIOS bug, but valid behavior since the Windows ACPI-WMI mapper
> converts the ACPI objects into a common buffer format as described here:
>
> https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/driver-defined-wmi-data-items
>
Hi Armin,
I did see this link when you mentioned it earlier, and I understand that it's
specifying the packed and internally aligned buffer format that WMI on Windows
expects when a Windows driver provides a WMI data block.
This to me is a different question from whether an ACPI object in the BIOS,
one which will be converted to a WMI object by Windows later, should contain
UTF-16. I didn't find a single other example in all the ACPI dumps in the Linux
Hardware Database [1] of such an ACPI object.
So the answer to the question seems like a "SHOULD NOT". And someone at HP
definitely did a bad copy-paste when it came to this BIOS. I feel comfortable
calling it a bug (the leading "4" makes it one in any case).
> I assume that the mapper converts the ACPI string into a WMI string buffer, and that
> a common ACPI buffer is just passed as-is. In this case, the error lies inside the
> linux WMI subsystem, which does not do such a conversion.
>
> I can try to find out more about this conversion and its rules, and use this to add
> support for that to the WMI subsystem. This would prevent such errors in the future
> and would bring us closer to full ACPI WMI support inside the kernel.
Yes, if the ACPI-WMI mapping driver handles already existing UTF-16 in an ACPI
buffer as we have here, it would be good for us to support that as well.
Hopefully Łukasz can find a Windows machine to help determine if it does.
Earlier, you mentioned converting an ACPI object into the packed buffer format
that Windows expects. But is there some reason I'm missing for us to also pack
things like that in the first place? I assume that this format exists for
convenience (returning multiple values) or space reasons, and such a WMI
buffer is eventually unpacked into its various components according to the MOF
anyway. At least for WMI drivers on Linux, I think it would make more sense to
transparently convert the UTF-16 string to UTF-8 and pretend that the property
was an ACPI_TYPE_STRING all along.
And now I'm thinking out loud, but if WMI doesn't allow arbitrary binary data
(and from the WMI buffer spec you linked, it doesn't), and the Windows ACPI-WMI
mapper can indeed handle UTF-16, then ACPI_TYPE_BUFFER in ACPI objects intended
to become WMI objects can only contain UTF-16.
> This will take quite some time however, so i would suggest adding a quirk handler
> first and replace this with the WMI conversion functions later.
No worries.
[1] https://github.com/linuxhw/ACPI/
next prev parent reply other threads:[~2023-11-01 4:34 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
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 [this message]
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=ZUHVUkzDfPX16+7P@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.