From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795015032; b=J0k6TY7EBDMtarhHoJTwCzLXvWo3BedtIr7z2v2r0yS1Goi4NQbdz9AuZEubF1xCFu9+ wBZKFVRHDlkHDNEbPT+xTgwhY/RRWp/LW7nYePWT0rl0f4yiXdiLjDuA/Jp+kuFYZtLlq BwaFME9jwNEymRwUFJVz+PtdJ4jqB8afynlOrePcO2dIQyNTiHE8Oyc81QijZQs9JA/g3 kcUF6lgXzgprzNpNZY49XZdPRpfcsRaLV5oQEp7ZYHowsVPZ6HyW8MGWNjgZrsNov+KF4 sg1cZpCmIhjV0KEOfuAlm5uQIlzYLem6AZ5QdkzKrZZQ/0Z+k+8akHdpLsHXUTIWWNg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795015032; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=7sy22lvvY7r/dZOvS/YHgqh44xsoFOXVFLNRmVEvARo=; b=nXPtoatTooei8xlX9nQ66dDc1ZNdt5C064UC7xoOSRKxTzzo0ZSBE+HHK499EOiUPxm9 B1ndEn/1PK3Lj03TLnUOxRQ6jzSAWqXHk3yrxvX5KpIjf9KoIl3dbr4cmwTIzOtR05dsX myONeSCz5Z8FMJKtVkQW0nkH93Ow+EVaruddFmpigvsC0NYCbKhRmk2hgGEdO97sluWJw zrSYuCzScmFSsvxWVxtwg5s4OIln/7kuZ5XK4WlkFvPUswqhmLNuVBgBaEl3ezxQ3jErI Ceseaopr3g+W7uOBvPj+yudStrxu3nbiN9FOuxQaDzR2zp39M76D+96sTJ/PYVD8q4Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tPSTeswv; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3D6F606A31C; Wed, 18 Nov 2026 15:17:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tPSTeswv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1315B1F000C4; Wed, 18 Nov 2026 15:17:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795015032; bh=7sy22lvvY7r/dZOvS/YHgqh44xsoFOXVFLNRmVEvARo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tPSTeswvqqrhNC7xJ9UxO8P8J9kmr+8NRlIVM+zTayCSKYwbaMilF2qwuARAboA7w KlMdMHYGnO/dPJp75WSJ1ul+AN2bmMmWrRgoPKyovEIrHZvz1PCZB396pCcBBASL0Q CYn9/+AQupNBGr8l6/J1csebWhPTTEgaC3fkuAWo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Ali=20Ahmet=20Memi=C5=9F?= , Rong Zhang , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 7.3 0009/2651] platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively Date: Wed, 18 Nov 2026 15:20:49 +0100 Message-ID: <20261118150248.334456330@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150247.972732815@linuxfoundation.org> References: <20261118150247.972732815@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ali Ahmet Memiş [ Upstream commit f91c2cd6dbcedf52e227b2eea8d7b99ecbac7552 ] On some Lenovo IdeaPad and Yoga models, the battery _BIX takes the EC AML mutex and then calls the serialized RDER through RDIF, while GBMD calls RDER first and then takes the EC mutex. When the two run interleaved they deadlock until the mutex acquisition in RDER times out, and GBMD returns garbage that is reported as both charge types being enabled. Evaluate all methods with the exclusive helpers, so that GBMD never runs interleaved with the battery methods. Link: https://bugzilla.kernel.org/show_bug.cgi?id=221065 Link: https://lore.kernel.org/all/58586fa666f09c209f9d7fe8c692a8bdda6d4410.camel@rong.moe/ Signed-off-by: Ali Ahmet Memiş Reviewed-by: Rong Zhang Cc: All applicable # 80892972ff23 ACPI: utils: Add exclusive AML evaluation helpers Link: https://patch.msgid.link/20261018122348.679126-1-aliamemis@disroot.org Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/platform/x86/lenovo/ideapad-laptop.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/lenovo/ideapad-laptop.c b/drivers/platform/x86/lenovo/ideapad-laptop.c index 8213524504eeb..1335f4e488702 100644 --- a/drivers/platform/x86/lenovo/ideapad-laptop.c +++ b/drivers/platform/x86/lenovo/ideapad-laptop.c @@ -297,12 +297,16 @@ static void ideapad_shared_exit(struct ideapad_private *priv) #define IDEAPAD_EC_POLL_MIN_US 150 #define IDEAPAD_EC_POLL_MAX_US 300 +/* + * On some models GBMD and the battery _BIX take the EC mutex and a + * serialized method in opposite order, so evaluate all methods 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 +328,7 @@ 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, ¶ms, &result); + status = acpi_evaluate_integer_exclusive(handle, (char *)name, ¶ms, &result); if (ACPI_FAILURE(status)) return -EIO; @@ -336,7 +340,7 @@ 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); + acpi_status status = acpi_execute_simple_method_exclusive(handle, (char *)name, arg); return ACPI_FAILURE(status) ? -EIO : 0; } @@ -394,7 +398,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", ¶ms, NULL); + status = acpi_evaluate_object_exclusive(handle, "VPCW", ¶ms, NULL); if (ACPI_FAILURE(status)) return -EIO; -- 2.53.0