From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796477615; b=cgswO0ZWpFMv/vqIRK4nzobPPwfIoyvrz0hDdXO2tOD1sf2p37tKppYP4jRaY5OoHZyS pt6F1CGnZusVy5gIQ11nwm3eYdiow1Z0CiId79J8hbW8DE9aGEKBBsfULEYDSoZkOerCN 4oaq5uL+SxcFeX/a8eDTkzD2v4WZ6xTJ/QRksGobOD5ICyav0ozTBoKQM9fixUDG+2iZH hpsGMDy9RAHkf/j9+9s5tupRtG8JB5nOEmUM3Y6V3HW0DY0Oe9jP6SzGpvkcZBpCTL5Aj tATNrlzRyyUCDKuB/HoEQzeGWevoU3EvB6YWPmmV+15cgIJQtTpq1AtDrFc60AScR5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796477615; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=iN/9AS8yRZFX3mVLRH+6+c0s1FAMvMeL6pp6zHr4NOE=; b=e+4N7SSw51l48fEUTqdcpnzyjS7V11gypeqRgAkBk9MEIIWVXJQ1Z0G4rMIkL6lrnSIO 5y4oHOIOD9CrWEzr23rP9qiO7BDnlJ9EIN/GpkTK7tmIJhv6rfNpN5+MC8nRUD9GWu7Si EHUCXeXyemb2jCRnFIirGVZ+SCZnvwCATGOdBo2k8OUkefRK/Ut36CGJZ5TPrxcOXTjMQ 2BtTxaXW12pIxanqfTrneBwNc5G9R+4E1VZwUMEIynTB+5Z4FK10B6LS1OZGsT+oQs71e RYDKg9R4Bp/Qj4f92B186d85j52tVLFGtmnSeB5nWZpPALovMhPhWJAP7P78nejlxiA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass header.d=beagleboard.org header.i=@beagleboard.org header.a=rsa-sha256 header.s=google header.b=Q5U8jIBo; arc=none smtp.remote-ip=74.125.82.43 Received: from mail-dl1-f43.google.com (mail-dl1-f43.google.com [74.125.82.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48F80606A322 for ; Sat, 5 Dec 2026 13:33:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48F80606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=beagleboard.org header.i=@beagleboard.org header.a=rsa-sha256 header.s=google header.b=Q5U8jIBo Received: by mail-dl1-f43.google.com with SMTP id a92af1059eb24-1b5d5f3d5b8so1916153c88.0 for ; Sat, 05 Dec 2026 05:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard.org; s=google; t=1796477614; x=1797082414; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:user-agent :message-id:date:references:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to:content-type; bh=iN/9AS8yRZFX3mVLRH+6+c0s1FAMvMeL6pp6zHr4NOE=; b=Q5U8jIBoqv1W5a0ZkzFqceP2TEmS+vriGvFvFlC7p+SVMU1K7smv6UIvNNXYxPJPBb IOWGHNYW/Ev73K+xoYQbXWLxebNnKcgNtNUe2ms4n009WMMV4A7g2ePm0Q3EG6lCRU/R D2KdH65cYKCGxQZTVJQOcYxCg5h3iFE0oIaMfA1ZNtpGzcbnzA57/fORvYadEttCTaiH JgPDWP8u/Of1BN0HsfYtg/K8H9HdeGUwum8Hk1S61psRUTx8P0K5c/44WFYEJJdBkBvy sexN+QouzMCvhiLKQsJWYHUe1tVKRledPBYFeC9HmTx6EKG/k32mD+4m++rp3XFQMQDD qdlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796477614; x=1797082414; h=content-transfer-encoding:content-type:mime-version:user-agent :message-id:date:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iN/9AS8yRZFX3mVLRH+6+c0s1FAMvMeL6pp6zHr4NOE=; b=EJMftptfUrbka4ZZZBf6VXwnJOSIJFLbMQzIlIR3fgbHXLQfaIt7Jyj7GSNrN7/bF6 BfrK+JiiHp0+rHp3wsYEosIastqJW5Y56kJJYyNMOo6yQ719DOpYtlLN7tLTfKXe4vpv VCFmNoW90N+Z5PHLk5CRq4Bugtay/DbB6ic48dA8Shsckxv++q22FHq+IzzrMAeUi5TN C7gnkTQCCHU3LQzhl3LLWTGxWZcfggAbq7XwhkeRjyUMYIcGHef2mmI3SeNzMCRwV5RN Ol3HKmK2XkLyypx6fCA84eUTF+rydJf3FTTYT+dUGhtxMFK1ze8prKHCBFegqC3H330O dphA== X-Forwarded-Encrypted: i=1; AL+hErExMjUYgd4yaib5bzft7/MHNNetPxnoYs3sWLE/uJ/naJxzF7aUFERK5KZtMx3+ItZBQ6UuyGMpgvMQkWA=@vger.kernel.org X-Gm-Message-State: APuU4Z+X6pT5Y7VwOu/vAv9zklXmnQx5r2MCwmZ2wVXIxGj+J6eglGyc 8vA8rAOfGrM/IBWESaEN87MEkzBmQkp+qHLYdEa0OCV+URTd6g3EWUAk3aar1vvPc3vWWXiaLV/ 3HH8= X-Gm-Gg: AZFdTZfSk5rDqB4AcZv/Pl9w95PNZPXQnssQ/IpT+f12ILwytgz2zx/k4XJyJIVWnmU kYuDhIlL1J8mOUyFf9titnAQR5YqATzZqrf9AjvU4ccC0L1jEMctcwp9+10pawiVHb0AqNbaBUK 0cLUzjrKOejhDxst/VAaXVZb3A5zIuu7mkFadn4M5kYNcxSZ8dnKgb73myD5jrph8vj9ubTdkLE iCzSW/+/8p+aL0BnrFczp6xOpF/7DU6Opjzhx4iBFlrlc86OVzla6qUxpK5qOUtywTpry9CgZpW r1+vAVhioN8+W2WOrO9Ei7+8cscTJUJ0A5sjVfNaeCTzXrT9HrA7ue7LzAK62bbnGSv49n76SXp BUQzBMl8fbKPvWvMMynT+JNDX0xNXt86X/ys3CzR7lNzpsS4J7jD2ksP169rH7aCJCH5kQnjn6L w/W3LkUguqaoaHl2hsH+M+ZQpQlgnFwB15sVikAonBkvpRYOIiH84D7uI4A8uaaOVsAe08tmoPZ W3gex+y8Hj6Vxmym1WxdISWZTcugbEENGhK/olJYxOEgYd5MU7HIoVlZZFCZID2FmiwuHiT1PG9 B9nd0VY25x41t2AgFdIBW7uqYwumXcYUvV6dcv1AYuwRmOqrUq8= X-Received: by 2002:a05:7022:b056:20b0:1b5:39fb:c6ba with SMTP id a92af1059eb24-1b5d726df1cmr4865044c88.35.1796477613928; Sat, 05 Dec 2026 05:33:33 -0800 (PST) Received: from lpfedora ([2405:201:2044:e837:e8dd:ccc0:b676:593b]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5d642de41sm15418975c88.3.2026.12.05.05.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 05:33:33 -0800 (PST) From: Ayush Singh To: "Rafael J. Wysocki (Intel)" Cc: Ayush Singh , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ACPI: power: Evaluate power resource _ON methods exclusively In-Reply-To: References: <20261126-ssd-fix-v2-1-32c91f6532e3@beagleboard.org> Date: Sat, 05 Dec 2026 19:03:28 +0530 Message-ID: <87zeuj6edz.fsf@beagleboard.org> User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: linux-kernel@vger.kernel.org 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: quoted-printable "Rafael J. Wysocki (Intel)" writes: > On Thu, Nov 26, 2026 at 6:21=E2=80=AFPM Ayush Singh wrote: >> >> On the Lenovo Yoga Pro 7 14AKP10 (83KG, AMD Krackan), the NVMe drive in >> the second M.2 slot is frequently lost after resuming from s2idle: >> >> pcieport 0000:00:02.1: broken device, retraining non-functional downst= ream link at 2.5GT/s >> pcieport 0000:00:02.1: retraining failed >> pcieport 0000:00:02.1: Data Link Layer Link Active not set in 100 msec >> nvme nvme1: Disabling device after reset failure: -19 >> >> The _ON methods of the two M.2 slots' power resources update a clock >> control register shared by both slots without any locking, and sleep in >> the middle of the update. Since the root ports are resumed >> asynchronously, the two methods can run concurrently, and one of them >> can undo the other's change, leaving that slot's reference clock >> disabled. Its link then never trains. >> >> The same symptom has been reported on the closely related IdeaPad Pro 5 >> 14AKP10 (83JL) [0], which likely has the same problem and should be >> fixed by this as well. >> >> Evaluate power resource _ON methods one at a time using the >> acpi_evaluate_object_exclusive() helper. With this, 20/20 >> s2idle cycles succeeded, versus failure within 1-2 cycles before. >> Also tested in normal laptop usage for a few days. >> >> [0]: https://ratatoskr.run/linux-pci/2026/04/6586201/t >> >> Suggested-by: Rafael J. Wysocki >> Assisted-by: claude-opus-5-5 >> Signed-off-by: Ayush Singh >> --- >> On the Lenovo Yoga Pro 7 14AKP10 (83KG, AMD Krackan, BIOS QFCN29WW), >> the NVMe drive behind root port 00:02.1 (ACPI GPP3) is lost on nearly >> every s2idle resume, while the drive in the other M.2 slot (GP10) always >> comes back. Updating to the latest BIOS did not help, and neither did >> disabling SSD power management via kernel parameters or recovering the >> device from userspace. >> >> The "broken device, retraining non-functional downstream link at >> 2.5GT/s" / "retraining failed" messages come from the Target Speed quirk >> reacting to a link that cannot train at all. The actual cause is a race >> between the two slots' power resource _ON methods in firmware, which >> can leave one slot's reference clock disabled, as described in the >> patch. I can share the relevant AML and debug logs if useful. >> >> Testing: 20/20 s2idle cycles with real S0i3 residency, versus failure >> within 1-2 cycles without the patch. I have also done normal daily use >> testing outside of synthetic suspend. >> >> The IdeaPad Pro 5 14AKP10 (83JL) appears to have the same problem on >> the same root port [0]. >> >> As suggested, we now use acpi_evaluate_object_exclusive >> unconditionally. >> >> [0]: https://ratatoskr.run/linux-pci/2026/04/6586201/t >> --- >> Changes in v2: >> - Switch to using acpi_evaluate_object_exclusive() unconditionally >> - Link to v1: https://lore.kernel.org/r/20261124-ssd-fix-v1-1-ee8ef43190= b1@beagleboard.org >> --- >> drivers/acpi/power.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c >> index 23a4e207a01e..82c8af6f8c7a 100644 >> --- a/drivers/acpi/power.c >> +++ b/drivers/acpi/power.c >> @@ -368,7 +368,7 @@ static int __acpi_power_on(struct acpi_power_resourc= e *resource) >> struct acpi_power_dependent_device *dep; >> acpi_status status =3D AE_OK; >> >> - status =3D acpi_evaluate_object(handle, "_ON", NULL, NULL); >> + status =3D acpi_evaluate_object_exclusive(handle, "_ON", NULL, N= ULL); >> if (ACPI_FAILURE(status)) { >> resource->state =3D ACPI_POWER_RESOURCE_STATE_UNKNOWN; >> return -ENODEV; >> >> --- > > Unfortunately, this doesn't work for reasons explained by Sashiko: > > https://sashiko.dev/#/patchset/20261126-ssd-fix-v2-1-32c91f6532e3%40beagl= eboard.org > > So after all, using a separate lock around _ON and _OFF evaluation is > a better approach. In patch v1, I was only serializing _ON. At least in my particular case, there was no problem related to _OFF methods. Do you want both serialized? Best Regards, Ayush Singh --=20 BeagleBoard.org Foundation https://www.beagleboard.org