[PATCH] platform/x86: bitland-mifs-wmi: Only check the function id of GET responses

From: Chris Taraszka

Date: Mon Sep 28 2026 - 11:54:04 EST


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@xxxxxx>
Signed-off-by: Chris Taraszka <chris@xxxxxxxxx>
---

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