* [PATCH v2 0/2] platform/x86: bitland-mifs-wmi: Xiaomi Book Pro 14 support
@ 2026-10-25 19:54 Chris Taraszka
2026-10-25 19:54 ` [PATCH v2 1/2] platform/x86: bitland-mifs-wmi: Add Xiaomi Book Pro 14 quirk Chris Taraszka
2026-10-25 19:54 ` [PATCH v2 2/2] platform/x86: bitland-mifs-wmi: Don't fail suspend or resume on profile errors Chris Taraszka
0 siblings, 2 replies; 3+ messages in thread
From: Chris Taraszka @ 2026-10-25 19:54 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Mingyou Chen, Ilya Gladyshev,
Armin Wolf, KentoNion, Matias Civadda, Chris Taraszka
Two patches on top of Mingyou Chen's v13 "Merge redmi-wmi into
bitland-mifs-wmi" [1], which adds the quirks table they build on.
Patch 1 adds the Xiaomi Book Pro 14 (TM2424) entry. Patch 2 stops
platform profile save/restore errors from failing system suspend or
resume.
Kento proposed a different mapping for the same board [2]: low-power
as 0x0a (which also dims the panel and keyboard backlight), balanced as
0x09, performance as 0x04 with 0x03 as fallback, and no
balanced-performance. This series keeps the four distinct firmware
modes and leaves 0x0a to the firmware's own mode cycling. Kento, if
this is a problem on BIOS 0707 or 0A0A, please say so.
Mingyou, on your v13 question: with 7/7, accept_zero_function is not
needed here. The entry does not set it and every SET succeeds.
Changes since v1 [3][4]:
- Use the quirks table from v13 instead of a DMI conditional in the code
- Match on board name TM2424 (Kento)
- Suspend fix also covers resume and skips the restore when nothing
was saved
[1] https://lore.kernel.org/all/20261021123414.25516-1-qby140326@gmail.com/
[2] https://lore.kernel.org/all/20260929144703.700966-1-kento@kekto.ru/
[3] https://lore.kernel.org/all/20260928153902.139956-1-chris@miget.com/
[4] https://lore.kernel.org/all/20260911182131.461415-1-chris@miget.com/
Chris Taraszka (2):
platform/x86: bitland-mifs-wmi: Add Xiaomi Book Pro 14 quirk
platform/x86: bitland-mifs-wmi: Don't fail suspend or resume on
profile errors
drivers/platform/x86/bitland-mifs-wmi.c | 43 +++++++++++++++++++++----
1 file changed, 36 insertions(+), 7 deletions(-)
base-commit: 9d3475065167197742b0882aff21cf8e78393277
prerequisite-patch-id: 99b10cd2b70d630ab65d8a8bb02c1d4bf89b1a63
prerequisite-patch-id: 27db041f827872b8be142c310a14c79962154bd5
prerequisite-patch-id: 74fc3298fa3dceb2224dfc3d2ae4cc6d4be61c01
prerequisite-patch-id: 2bbb1371b506f5a07a1e6e69d34217195cd5ffcb
prerequisite-patch-id: b88e60d7915ad055b67478359bd9c6c9482d8433
prerequisite-patch-id: 2fe8c043993034f1a2cde98b1b2e299987d5ac7f
prerequisite-patch-id: fbf70405992dfa75ed02026d97aa16e1644fbd42
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] platform/x86: bitland-mifs-wmi: Add Xiaomi Book Pro 14 quirk
2026-10-25 19:54 [PATCH v2 0/2] platform/x86: bitland-mifs-wmi: Xiaomi Book Pro 14 support Chris Taraszka
@ 2026-10-25 19:54 ` Chris Taraszka
2026-10-25 19:54 ` [PATCH v2 2/2] platform/x86: bitland-mifs-wmi: Don't fail suspend or resume on profile errors Chris Taraszka
1 sibling, 0 replies; 3+ messages in thread
From: Chris Taraszka @ 2026-10-25 19:54 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Mingyou Chen, Ilya Gladyshev,
Armin Wolf, KentoNion, Matias Civadda, Chris Taraszka
The Xiaomi Book Pro 14 (board TM2424) implements SystemPerMode with
its own values. Its firmware ignores 0x00 and 0x01, and GET returns one
of 0x02, 0x03, 0x04, 0x09 or 0x0a, so with the default table balanced
and balanced-performance are no-ops and reading the profile fails with
-EINVAL whenever the firmware is in 0x04, 0x09 or 0x0a. The failed read
also aborts system suspend.
The values were identified from the WMAA method in the firmware's SSDT
and by setting each one and reading the sustained package power limit
from intel-rapl-mmio on AC:
0x02 18 W
0x03 37 W
0x09 45 W
0x04 58 W
0x0a 18 W
Map low-power, balanced, balanced-performance and performance to 0x02,
0x03, 0x09 and 0x04. 0x0a is only entered through the firmware's own
mode cycling, so report it as low-power without offering it for SET.
The machine is USB-C only and WMI_FN_SYSTEM_AC_TYPE is not implemented,
so skip the AC type check.
Signed-off-by: Chris Taraszka <chris@miget.com>
---
Notes:
Tested on the Xiaomi Book Pro 14 (TM2424, BIOS XMAPT4B0P0A0A) with this
series on top of v13, backported to v7.3, on AC: all four profiles set
and read back, and the firmware mode (EC 0x68) and PL1 follow:
0x02/18 W, 0x03/37 W, 0x09/45 W, 0x04/58 W. These match the values
first measured on BIOS XMAPT4B0P0909. s2idle suspend/resume from
performance restores 0x04.
On battery, balanced-performance and performance are refused by
bitland_pp_check_capability(), although BIOS 0909 applies 0x04 on
battery. This patch leaves that check as it is.
drivers/platform/x86/bitland-mifs-wmi.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index a4c341ffbb9b..73be63146fd5 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -116,7 +116,28 @@ static const struct bitland_mifs_quirks default_quirks = {
.num_profile_entries = ARRAY_SIZE(default_profile_entries),
};
+static const struct bitland_profile_entry tm2424_profile_entries[] = {
+ { PLATFORM_PROFILE_LOW_POWER, 0x02 },
+ { PLATFORM_PROFILE_LOW_POWER, 0x0a, true },
+ { PLATFORM_PROFILE_BALANCED, 0x03 },
+ { PLATFORM_PROFILE_BALANCED_PERFORMANCE, 0x09 },
+ { PLATFORM_PROFILE_PERFORMANCE, 0x04 },
+};
+
+static const struct bitland_mifs_quirks tm2424_quirks = {
+ .profile_entries = tm2424_profile_entries,
+ .num_profile_entries = ARRAY_SIZE(tm2424_profile_entries),
+ .skip_ac_type_check = true,
+};
+
static const struct dmi_system_id bitland_mifs_dmi_table[] = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "XIAOMI"),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2424"),
+ },
+ .driver_data = (void *)&tm2424_quirks,
+ },
{}
};
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] platform/x86: bitland-mifs-wmi: Don't fail suspend or resume on profile errors
2026-10-25 19:54 [PATCH v2 0/2] platform/x86: bitland-mifs-wmi: Xiaomi Book Pro 14 support Chris Taraszka
2026-10-25 19:54 ` [PATCH v2 1/2] platform/x86: bitland-mifs-wmi: Add Xiaomi Book Pro 14 quirk Chris Taraszka
@ 2026-10-25 19:54 ` Chris Taraszka
1 sibling, 0 replies; 3+ messages in thread
From: Chris Taraszka @ 2026-10-25 19:54 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Mingyou Chen, Ilya Gladyshev,
Armin Wolf, KentoNion, Matias Civadda, Chris Taraszka
bitland_mifs_wmi_suspend() returns the laptop_profile_get() error to
the PM core, which aborts the whole system suspend. This happens on any
machine whose firmware reports a SystemPerMode value that is missing
from its profile table, and on such a laptop with the lid closed logind
keeps retrying the suspend, so the machine stays awake and drains its
battery.
bitland_mifs_wmi_resume() likewise returns any error other than
-EOPNOTSUPP from restoring the profile, so the resume is reported as
failed although the machine is fully usable.
Saving and restoring the platform profile is best effort. Warn and
continue instead of failing the system transition, and skip the restore
when nothing was saved, so resume does not write a stale or default
profile.
Fixes: dc1ec4fa86b2 ("platform/x86: bitland-mifs-wmi: Add new Bitland MIFS WMI driver")
Signed-off-by: Chris Taraszka <chris@miget.com>
---
Notes:
Tested on the same machine with v13 and this patch, without patch 1,
and the firmware in 0x04. v13 alone aborts a pm_test=devices suspend:
bitland_mifs_wmi_suspend [bitland_mifs_wmi] returns -22
PM: failed to suspend: error -22
With this patch the suspend completes, "Failed to save platform
profile: -22" is logged and the firmware is still in 0x04 after resume.
This supersedes "platform/x86: bitland-mifs-wmi: Don't abort suspend
when platform profile access fails" [1], reworked on top of v13 6/7.
[1] https://lore.kernel.org/all/20260911182131.461415-1-chris@miget.com/
drivers/platform/x86/bitland-mifs-wmi.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 73be63146fd5..df9a931fa939 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -237,6 +237,7 @@ struct bitland_mifs_wmi_data {
struct device *pp_dev;
const struct bitland_mifs_quirks *quirks;
enum platform_profile_option saved_profile;
+ bool profile_saved;
};
static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data,
@@ -408,10 +409,15 @@ static int bitland_mifs_wmi_suspend(struct device *dev)
return 0;
ret = laptop_profile_get(data->pp_dev, &profile);
- if (ret == 0)
- data->saved_profile = profile;
+ data->profile_saved = !ret;
+ if (ret) {
+ dev_warn(dev, "Failed to save platform profile: %d\n", ret);
+ return 0;
+ }
- return ret;
+ data->saved_profile = profile;
+
+ return 0;
}
static int bitland_mifs_wmi_resume(struct device *dev)
@@ -419,8 +425,8 @@ static int bitland_mifs_wmi_resume(struct device *dev)
struct bitland_mifs_wmi_data *data = dev_get_drvdata(dev);
int ret;
- /* Skip event device */
- if (!data->pp_dev)
+ /* Skip event device, or nothing was saved on suspend */
+ if (!data->pp_dev || !data->profile_saved)
return 0;
ret = laptop_profile_set(dev, data->saved_profile);
@@ -436,8 +442,10 @@ static int bitland_mifs_wmi_resume(struct device *dev)
}
}
- dev_dbg(dev, "Resuming, restoring profile %d\n", data->saved_profile);
- return ret;
+ if (ret)
+ dev_warn(dev, "Failed to restore platform profile: %d\n", ret);
+
+ return 0;
}
static DEFINE_SIMPLE_DEV_PM_OPS(bitland_mifs_wmi_pm_ops,
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-25 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 19:54 [PATCH v2 0/2] platform/x86: bitland-mifs-wmi: Xiaomi Book Pro 14 support Chris Taraszka
2026-10-25 19:54 ` [PATCH v2 1/2] platform/x86: bitland-mifs-wmi: Add Xiaomi Book Pro 14 quirk Chris Taraszka
2026-10-25 19:54 ` [PATCH v2 2/2] platform/x86: bitland-mifs-wmi: Don't fail suspend or resume on profile errors Chris Taraszka
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®