[PATCH 4/4] platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively

From: Ali Ahmet Memiş

Date: Wed Oct 14 2026 - 15:10:46 EST


On some Lenovo IdeaPad and Yoga models, GBMD, SBMC, SALS and DYTC hold a
shared AML mutex while waiting for the EC to finish a command, long
enough for the UCSI and _Qxx methods waiting on it to time out.

Evaluate all methods with the exclusive helpers.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221065
Signed-off-by: Ali Ahmet Memiş <aliamemis@xxxxxxxxxxx>
---
drivers/platform/x86/lenovo/ideapad-laptop.c | 21 ++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/lenovo/ideapad-laptop.c b/drivers/platform/x86/lenovo/ideapad-laptop.c
index 8213524504ee..9fb842e6383d 100644
--- a/drivers/platform/x86/lenovo/ideapad-laptop.c
+++ b/drivers/platform/x86/lenovo/ideapad-laptop.c
@@ -297,12 +297,18 @@ static void ideapad_shared_exit(struct ideapad_private *priv)
#define IDEAPAD_EC_POLL_MIN_US 150
#define IDEAPAD_EC_POLL_MAX_US 300

+/*
+ * Some of these methods hold an AML mutex shared with the UCSI and EC
+ * query methods for long enough for those to time out, so evaluate all
+ * of them exclusively.
+ */
static int eval_int(acpi_handle handle, const char *name, unsigned long *res)
{
unsigned long long result;
acpi_status status;

- status = acpi_evaluate_integer(handle, (char *)name, NULL, &result);
+ status = acpi_evaluate_integer_exclusive(handle, (char *)name, NULL,
+ &result);
if (ACPI_FAILURE(status))
return -EIO;

@@ -324,7 +330,8 @@ static int eval_int_with_arg(acpi_handle handle, const char *name, unsigned long
in_obj.type = ACPI_TYPE_INTEGER;
in_obj.integer.value = arg;

- status = acpi_evaluate_integer(handle, (char *)name, &params, &result);
+ status = acpi_evaluate_integer_exclusive(handle, (char *)name, &params,
+ &result);
if (ACPI_FAILURE(status))
return -EIO;

@@ -336,7 +343,13 @@ static int eval_int_with_arg(acpi_handle handle, const char *name, unsigned long

static int exec_simple_method(acpi_handle handle, const char *name, unsigned long arg)
{
- acpi_status status = acpi_execute_simple_method(handle, (char *)name, arg);
+ union acpi_object in_obj = { .type = ACPI_TYPE_INTEGER };
+ struct acpi_object_list params = { .count = 1, .pointer = &in_obj };
+ acpi_status status;
+
+ in_obj.integer.value = arg;
+ status = acpi_evaluate_object_exclusive(handle, (char *)name, &params,
+ NULL);

return ACPI_FAILURE(status) ? -EIO : 0;
}
@@ -394,7 +407,7 @@ static int eval_vpcw(acpi_handle handle, unsigned long cmd, unsigned long data)
in_obj[1].type = ACPI_TYPE_INTEGER;
in_obj[1].integer.value = data;

- status = acpi_evaluate_object(handle, "VPCW", &params, NULL);
+ status = acpi_evaluate_object_exclusive(handle, "VPCW", &params, NULL);
if (ACPI_FAILURE(status))
return -EIO;

--
2.55.0