[PATCH 1/7] platform/x86: asus-wmi: dump buffer replies in the debugfs dsts file
From: Bartu Alev
Date: Sun Nov 01 2026 - 05:47:15 EST
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@xxxxxxxxx>
---
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;
+ 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)
--
2.56.0