mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ali Ahmet Memiş" <aliamemis@disroot.org>
To: "Rafael J . Wysocki" <rafael@kernel.org>
Cc: "Hans de Goede" <johannes.goede@oss.qualcomm.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Len Brown" <lenb@kernel.org>, "Ike Panhc" <ikepanhc@gmail.com>,
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	"Mark Pearson" <mpearson-lenovo@squebb.ca>,
	"Rong Zhang" <i@rong.moe>, "Armin Wolf" <W_Armin@gmx.de>,
	"Avraham Hollander" <anhollander516@gmail.com>,
	"Jeffrey Wälti" <jeffrey@waelti.dev>, Rick <rickk1166@gmail.com>,
	linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-usb@vger.kernel.org, acpica-devel@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] usb: typec: ucsi: acpi: Evaluate _DSM exclusively
Date: Wed, 14 Oct 2026 22:04:55 +0300	[thread overview]
Message-ID: <20261014190544.150093-4-aliamemis@disroot.org> (raw)
In-Reply-To: <20261014190544.150093-1-aliamemis@disroot.org>

On some Lenovo IdeaPad and Yoga models, the UCSI _DSM accesses the EC 25
times through helpers that take a shared AML mutex with a 1 s timeout
and return 0 when it times out, so UCSI commands fail under contention
with the battery and ideapad methods.

Evaluate the _DSM with acpi_evaluate_dsm_exclusive().

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221065
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
---
 drivers/usb/typec/ucsi/ucsi_acpi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
index 5697ccc24ec3..0b9aaf317d2b 100644
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -30,8 +30,12 @@ static int ucsi_acpi_dsm(struct ucsi_acpi *ua, int func)
 {
 	union acpi_object *obj;
 
-	obj = acpi_evaluate_dsm(ACPI_HANDLE(ua->dev), &ua->guid, 1, func,
-				NULL);
+	/*
+	 * On some Lenovo laptops the _DSM times out on the AML mutex it
+	 * shares with the battery and platform methods.
+	 */
+	obj = acpi_evaluate_dsm_exclusive(ACPI_HANDLE(ua->dev), &ua->guid, 1,
+					  func, NULL);
 	if (!obj) {
 		dev_err(ua->dev, "%s: failed to evaluate _DSM %d\n",
 			__func__, func);
-- 
2.55.0


  parent reply	other threads:[~2026-10-14 19:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 19:04 [PATCH 0/4] ACPI: Serialize EC queries, UCSI and ideapad methods Ali Ahmet Memiş
2026-10-14 19:04 ` [PATCH 1/4] ACPI: utils: Add acpi_evaluate_dsm_exclusive() Ali Ahmet Memiş
2026-10-14 19:04 ` [PATCH 2/4] ACPI: EC: Evaluate _Qxx methods exclusively Ali Ahmet Memiş
2026-10-14 19:04 ` Ali Ahmet Memiş [this message]
2026-10-14 19:04 ` [PATCH 4/4] platform/x86: ideapad-laptop: Evaluate ACPI " Ali Ahmet Memiş

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261014190544.150093-4-aliamemis@disroot.org \
    --to=aliamemis@disroot.org \
    --cc=W_Armin@gmx.de \
    --cc=acpica-devel@lists.linux.dev \
    --cc=anhollander516@gmail.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=i@rong.moe \
    --cc=ikepanhc@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jeffrey@waelti.dev \
    --cc=johannes.goede@oss.qualcomm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rickk1166@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®