* [PATCH] platform/x86: bitland-mifs-wmi: Only check the function id of GET responses
@ 2026-09-28 15:43 Chris Taraszka
2026-09-30 1:58 ` Anton Karasev
0 siblings, 1 reply; 2+ messages in thread
From: Chris Taraszka @ 2026-09-28 15:43 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Chris Taraszka, Armin Wolf
Commit 23cc56f6dea6 ("platform/x86: bitland-mifs-wmi: Detect failed
function calls") rejects every response whose function id does not
match the request.
The Xiaomi Book Pro 14 firmware (BIOS XMAPT4B0P0909) only fills in the
function id for GET operations. Its SET handlers clear the output buffer
and set only the return code, so a successful SystemPerMode SET returns
00 80 00 00 ...
instead of 00 80 00 08. The new mode is applied, but the driver returns
-ENOMSG, so every platform profile change is reported as failed:
Failed to write to acpi_platform_profile: Error writing
'/sys/firmware/acpi/platform_profile': No message of desired type
SET callers pass no output buffer and do not use the response, so only
validate the echoed function id when the caller asks for the output.
Fixes: 23cc56f6dea6 ("platform/x86: bitland-mifs-wmi: Detect failed function calls")
Cc: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Chris Taraszka <chris@miget.com>
---
Notes:
This is the separate fix mentioned in "[PATCH] platform/x86:
bitland-mifs-wmi: Add Xiaomi Book Pro 14 platform profile values".
All SET handlers in this firmware's WMAA method behave the same way:
only the GET handlers set the function id field. 23cc56f6dea6 is only in
pdx86 for-next so far, so no stable Cc.
Tested on the Xiaomi Book Pro 14 on AC with bitland-mifs-wmi from pdx86
for-next plus this patch and the Xiaomi profile values patch, loaded on
v7.3-rc5: every profile change through power-profiles-daemon succeeds,
where before each one failed with -ENOMSG despite being applied.
drivers/platform/x86/bitland-mifs-wmi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index dd1648b7de77..f4817b59dcac 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -189,11 +189,14 @@ static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data,
return -EIO;
}
+ if (!output)
+ return 0;
+
+ /* Some firmware only echoes the function id for GET operations */
if (result->function != input->function)
return -ENOMSG;
- if (output)
- memcpy(output, result, sizeof(*output));
+ memcpy(output, result, sizeof(*output));
return 0;
}
base-commit: fe5030c8cc7156223f48530e9b49aa87c0305bcd
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] platform/x86: bitland-mifs-wmi: Only check the function id of GET responses
2026-09-28 15:43 [PATCH] platform/x86: bitland-mifs-wmi: Only check the function id of GET responses Chris Taraszka
@ 2026-09-30 1:58 ` Anton Karasev
0 siblings, 0 replies; 2+ messages in thread
From: Anton Karasev @ 2026-09-30 1:58 UTC (permalink / raw)
To: chris; +Cc: hansg, ilpo.jarvinen, platform-driver-x86, linux-kernel, W_Armin
Hi Chris,
The Redmi Book Pro 16 2024 (DMI XIAOMI / TM2309, BIOS RMAMT6B0P0B0B)
behaves the same way: its WMAA SET branches only set the return code,
and only the GET branches fill in the function id.
Tested on that machine, kernel 7.2.7, with bitland-mifs-wmi from
for-next ("Detect failed function calls" and "Treat
WMI_FN_SYSTEM_AC_TYPE as optional" applied) built out of tree, on AC,
writing /sys/firmware/acpi/platform_profile directly:
- without this patch, every write of low-power, balanced and
performance failed with -ENOMSG, although the EC mode changed each
time (QFAN 2, 0 and 3 read back from the EC);
- with this patch, all of them succeed, and reading the profile back
still works.
Tested-by: Anton Karasev <uselessfire@gmail.com>
Thanks,
Anton Karasev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-30 1:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 15:43 [PATCH] platform/x86: bitland-mifs-wmi: Only check the function id of GET responses Chris Taraszka
2026-09-30 1:58 ` Anton Karasev
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®