From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Bartu Alev <bartualev@gmail.com>
Cc: Corentin Chary <corentin.chary@gmail.com>,
"Luke D. Jones" <luke@ljones.dev>,
Denis Benato <denis.benato@linux.dev>,
Hans de Goede <hansg@kernel.org>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
linux-hwmon@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
linux-api@vger.kernel.org
Subject: Re: [PATCH 1/7] platform/x86: asus-wmi: dump buffer replies in the debugfs dsts file
Date: Mon, 9 Nov 2026 20:09:36 +0200 (EET) [thread overview]
Message-ID: <09c087ac-d0a4-8665-552d-63d289104e3a@linux.intel.com> (raw)
In-Reply-To: <20261101-asus-fan-floors-v4-v1-1-b8d1c31a99a9@gmail.com>
On Sun, 1 Nov 2026, Bartu Alev wrote:
> Reading dsts calls asus_wmi_get_devstate(), which uses
> asus_wmi_evaluate_method(). Because that helper handles only
> ACPI_TYPE_INTEGER and leaves other return types zeroed, methods
> returning an ACPI buffer read as 0x0. This affects fan floor tables
> (0x00110026, 0x00110027, 0x00110033), fan curve getters (0x00110024,
> 0x00110025), and TUF RGB readback (0x0010005B).
>
> Evaluate the method through asus_wmi_evaluate_method_locked() directly,
> matching the call node, which keeps execution serialized against other
> WMI operations. Format integer replies as before, dump buffer
> contents with their byte length, and print any other type as t:<type>:
>
> DSTS(0x110026) = 16 bytes:
> 00000000: 00 00 00 00 19 30 3a 4a 00 00 00 00 00 00 00 00
>
> The sentinels 0xfffffffe and 0xffffffff continue to return -ENODEV.
>
> Signed-off-by: Bartu Alev <bartualev@gmail.com>
> ---
> drivers/platform/x86/asus-wmi.c | 46 ++++++++++++++++++++++++++++++++++-------
> 1 file changed, 39 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index b33ebdb21aa21..c55f469cb03dc 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -5038,16 +5038,48 @@ struct asus_wmi_debugfs_node {
> static int show_dsts(struct seq_file *m, void *data)
> {
> struct asus_wmi *asus = m->private;
> - int err;
> - u32 retval = -1;
> + struct bios_args args = {
> + .arg0 = asus->debug.dev_id,
> + };
> + struct acpi_buffer input = { (acpi_size) sizeof(args), &args };
> + struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
> + union acpi_object *obj;
> + acpi_status status;
> + u32 retval;
> + int err = 0;
>
> - err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval);
> - if (err < 0)
> - return err;
> + status = asus_wmi_evaluate_method_locked(asus->dsts_id, &input, &output);
> + if (ACPI_FAILURE(status))
> + return -EIO;
>
> - seq_printf(m, "DSTS(%#x) = %#x\n", asus->debug.dev_id, retval);
> + obj = (union acpi_object *)output.pointer;
Using __free() is preferred. Please also declare the variable here in
that case.
> + if (!obj)
> + return -ENODATA;
>
> - return 0;
> + switch (obj->type) {
> + case ACPI_TYPE_BUFFER:
> + seq_printf(m, "DSTS(%#x) = %u bytes:\n", asus->debug.dev_id,
> + obj->buffer.length);
> + seq_hex_dump(m, " ", DUMP_PREFIX_OFFSET, 16, 1,
> + obj->buffer.pointer, obj->buffer.length, false);
> + break;
> + case ACPI_TYPE_INTEGER:
> + retval = (u32)obj->integer.value;
> + if (retval == ASUS_WMI_UNSUPPORTED_METHOD || retval == (u32)~0)
> + err = -ENODEV;
> + else
> + seq_printf(m, "DSTS(%#x) = %#x\n", asus->debug.dev_id,
> + retval);
> + break;
> + default:
> + seq_printf(m, "DSTS(%#x) = t:%d\n", asus->debug.dev_id,
> + obj->type);
> + break;
> + }
> +
> + kfree(obj);
> +
> + return err;
> }
>
> static int show_devs(struct seq_file *m, void *data)
>
>
--
i.
next prev parent reply other threads:[~2026-11-09 18:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 10:46 [PATCH 0/7] platform/x86: asus-wmi: expose the firmware fan floor tables Bartu Alev
2026-11-01 10:46 ` [PATCH 1/7] platform/x86: asus-wmi: dump buffer replies in the debugfs dsts file Bartu Alev
2026-11-09 18:09 ` Ilpo Järvinen [this message]
2026-11-01 10:46 ` [PATCH 2/7] Documentation: ABI: document the ASUS custom fan curve attributes Bartu Alev
2026-11-01 10:46 ` [PATCH 3/7] platform/x86: asus-wmi: define the fan floor table DEVIDs Bartu Alev
2026-11-01 10:46 ` [PATCH 4/7] platform/x86: asus-wmi: read the firmware fan floor tables Bartu Alev
2026-11-09 18:23 ` Ilpo Järvinen
2026-11-01 10:46 ` [PATCH 5/7] platform/x86: asus-wmi: reject short fan curve replies Bartu Alev
2026-11-01 10:46 ` [PATCH 6/7] platform/x86: asus-wmi: expose the fan floor tables via hwmon Bartu Alev
2026-11-09 18:34 ` Ilpo Järvinen
2026-11-01 10:46 ` [PATCH 7/7] platform/x86: asus-wmi: show the effective duty for enabled curves Bartu Alev
2026-11-09 18:39 ` Ilpo Järvinen
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=09c087ac-d0a4-8665-552d-63d289104e3a@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bartualev@gmail.com \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=hansg@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luke@ljones.dev \
--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®