* [PATCH v3 1/2] platform/x86: bitland-mifs-wmi: Fix response payload copy size
2026-10-20 23:49 [PATCH v3 0/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling TuteMthCD
@ 2026-10-20 23:49 ` TuteMthCD
2026-10-21 12:36 ` Mingyou Chen
2026-10-20 23:49 ` [PATCH v3 2/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling TuteMthCD
2026-10-21 8:59 ` [PATCH v3 0/2] " Ilpo Järvinen
2 siblings, 1 reply; 5+ messages in thread
From: TuteMthCD @ 2026-10-20 23:49 UTC (permalink / raw)
To: platform-driver-x86
Cc: linux-kernel, qby140326, ilya.gladyshev, ilpo.jarvinen, hansg,
chris, TuteMthCD
sizeof(*output->data) copies only one byte, leaving the rest
uninitialized. Use sizeof(output->data) to copy the full 28-byte
response payload.
Signed-off-by: TuteMthCD <matias.civadda2342001@gmail.com>
---
drivers/platform/x86/bitland-mifs-wmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 44b16b7b4034..522b38e9755e 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -265,7 +265,7 @@ static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data,
if (output) {
output->return_code = return_code;
output->function = function;
- memcpy(output->data, payload_data, sizeof(*output->data));
+ memcpy(output->data, payload_data, sizeof(output->data));
}
return 0;
--
2.56.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v3 1/2] platform/x86: bitland-mifs-wmi: Fix response payload copy size
2026-10-20 23:49 ` [PATCH v3 1/2] platform/x86: bitland-mifs-wmi: Fix response payload copy size TuteMthCD
@ 2026-10-21 12:36 ` Mingyou Chen
0 siblings, 0 replies; 5+ messages in thread
From: Mingyou Chen @ 2026-10-21 12:36 UTC (permalink / raw)
To: TuteMthCD, platform-driver-x86
Cc: linux-kernel, ilya.gladyshev, ilpo.jarvinen, hansg, chris
On 10/21/26 07:49, TuteMthCD wrote:
> sizeof(*output->data) copies only one byte, leaving the rest
> uninitialized. Use sizeof(output->data) to copy the full 28-byte
> response payload.
>
> Signed-off-by: TuteMthCD <matias.civadda2342001@gmail.com>
> ---
> drivers/platform/x86/bitland-mifs-wmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
> index 44b16b7b4034..522b38e9755e 100644
> --- a/drivers/platform/x86/bitland-mifs-wmi.c
> +++ b/drivers/platform/x86/bitland-mifs-wmi.c
> @@ -265,7 +265,7 @@ static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data,
> if (output) {
> output->return_code = return_code;
> output->function = function;
> - memcpy(output->data, payload_data, sizeof(*output->data));
> + memcpy(output->data, payload_data, sizeof(output->data));
Hi,
I've included this fix in my v13.
> }
>
> return 0;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling
2026-10-20 23:49 [PATCH v3 0/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling TuteMthCD
2026-10-20 23:49 ` [PATCH v3 1/2] platform/x86: bitland-mifs-wmi: Fix response payload copy size TuteMthCD
@ 2026-10-20 23:49 ` TuteMthCD
2026-10-21 8:59 ` [PATCH v3 0/2] " Ilpo Järvinen
2 siblings, 0 replies; 5+ messages in thread
From: TuteMthCD @ 2026-10-20 23:49 UTC (permalink / raw)
To: platform-driver-x86
Cc: linux-kernel, qby140326, ilya.gladyshev, ilpo.jarvinen, hansg,
chris, TuteMthCD
The TIMI Redmi Book Pro 14 2022 (TM2107) stores the MIFS WMI return
code at the end of the response and uses different profile values:
0 for performance, 1 for balanced and 2 for low power.
Add a DMI entry using the existing quirks infrastructure to select
the correct response layout and profile mapping.
Skip the adapter-type query on this model to allow performance mode
with its USB-C charger, while retaining the external-power check.
Tested profile switching on physical TM2107 hardware.
Assisted-by: LLM
Signed-off-by: TuteMthCD <matias.civadda2342001@gmail.com>
---
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 522b38e9755e..8c1ec6f1166c 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 tm2107_profile_entries[] = {
+ { PLATFORM_PROFILE_LOW_POWER, 2 },
+ { PLATFORM_PROFILE_BALANCED, 1 },
+ { PLATFORM_PROFILE_PERFORMANCE, 0 },
+};
+
+static const struct bitland_mifs_quirks tm2107_quirks = {
+ .profile_entries = tm2107_profile_entries,
+ .num_profile_entries = ARRAY_SIZE(tm2107_profile_entries),
+ .return_code_at_end = true,
+ .skip_ac_type_check = true,
+};
+
static const struct dmi_system_id bitland_mifs_dmi_table[] = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TIMI"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2107"),
+ },
+ .driver_data = (void *)&tm2107_quirks,
+ },
{}
};
--
2.56.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v3 0/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling
2026-10-20 23:49 [PATCH v3 0/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling TuteMthCD
2026-10-20 23:49 ` [PATCH v3 1/2] platform/x86: bitland-mifs-wmi: Fix response payload copy size TuteMthCD
2026-10-20 23:49 ` [PATCH v3 2/2] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling TuteMthCD
@ 2026-10-21 8:59 ` Ilpo Järvinen
2 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2026-10-21 8:59 UTC (permalink / raw)
To: TuteMthCD
Cc: platform-driver-x86, LKML, qby140326, ilya.gladyshev,
Hans de Goede, chris
On Tue, 20 Oct 2026, TuteMthCD wrote:
> This series fixes platform profile handling on the TIMI Redmi Book Pro 14
> 2022 (TM2107), using the quirks infrastructure from Mingyou Chen's v12
> series:
>
> https://lore.kernel.org/all/20261012133648.132363-1-qby140326@gmail.com/
>
> Both patches apply on top of all six patches of that series. The first
> fixes the response payload copy size, as pointed out by Chris. The second
> adds the TM2107 profile mapping and response-layout quirks.
>
> Changes in v3:
> - Rebase onto Mingyou Chen's complete v12 series.
> - Reuse the existing quirks infrastructure instead of introducing
> separate response handling and profile tables.
> - Add the payload copy fix as a separate patch.
>
> Tested profile switching on physical TM2107 hardware.
>
> This is my first submission using a dependent patch series.
> Please let me know if I missed anything.
>
> TuteMthCD (2):
The patch series seems to be formed okay.
HOWEVER, there's still the problem that you don't use your real name for
signing off the patches so I cannot apply them as is. Effectively, you
should use the name you use for signing paper documents/contracts/etc.
Documentation/process/submitting-patches.rst explains what it means when
you sign off a patch.
> platform/x86: bitland-mifs-wmi: Fix response payload copy size
> platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling
>
> drivers/platform/x86/bitland-mifs-wmi.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
--
i.
^ permalink raw reply [flat|nested] 5+ messages in thread