Linux ACPI
 help / color / mirror / Atom feed
* [PATCH] gpiolib: acpi: Add ignore_wake quirk for Lenovo Legion Pro 5 16ADR10
@ 2026-11-25 15:43 shorezero via B4 Relay
  2026-11-26 10:49 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: shorezero via B4 Relay @ 2026-11-25 15:43 UTC (permalink / raw)
  To: Mika Westerberg, Andy Shevchenko, Linus Walleij,
	Bartosz Golaszewski
  Cc: linux-gpio, linux-acpi, shorezero

From: shorezero <shorezero@proton.me>

On the Lenovo Legion Pro 5 16ADR10 (83LT) the system resumes from S3
immediately after entering it, unless an external display is being
driven by the discrete NVIDIA GPU. A lid-close suspend therefore turns
into a suspend/resume loop (36 cycles in 11 minutes, about 10% battery).

With pm_debug_messages enabled the wake is attributed to pin 4 of the
AMD GPIO controller:

  PM: Triggering wakeup from IRQ 7
  GPIO 4 is active: 0x30047c00

Pin 4 is the only ACPI event interrupt the firmware declares
(\_SB.GPIO._AEI: GpioInt Edge, ActiveBoth, ExclusiveAndWake, debounce
0x1F4). Its _EVT handler only deals with the dGPU: in hybrid graphics
mode it runs the EC eject handshake (\_SB.GZFD.HTPE) and then does
Notify(\_SB.PCI0.GPP0.PEGP, 0x81). Lid events are delivered by the EC
through GPE 0x07, not through this pin.

Booting with gpiolib_acpi.ignore_wake=AMDI0030:00@4 makes suspend hold
(an RTC-timed suspend and a real lid-close suspend on battery with
nothing attached), and opening the lid still wakes the machine. Add a
DMI quirk to apply this automatically.

The investigation and this patch were prepared with an AI coding
assistant (Anthropic Claude: Opus 5.5 and Fable 5.2 models, run through
the Hermes agent). It collected and analysed the kernel logs,
disassembled the ACPI tables with iasl, proposed the test matrix, and
drafted the quirk entry and this changelog. I ran the hardware tests on
my machine and reviewed the change. Testing: the quirk entry was build-
tested with W=1 and passes checkpatch.pl --strict; the runtime behaviour
was verified with the equivalent gpiolib_acpi.ignore_wake= command line
parameter on 7.3.6, not with a kernel containing this patch.

Signed-off-by: shorezero <shorezero@proton.me>
---
 drivers/gpio/gpiolib-acpi-quirks.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpio/gpiolib-acpi-quirks.c b/drivers/gpio/gpiolib-acpi-quirks.c
index 3f89a8760..07613e13a 100644
--- a/drivers/gpio/gpiolib-acpi-quirks.c
+++ b/drivers/gpio/gpiolib-acpi-quirks.c
@@ -465,6 +465,22 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] __initconst = {
 			.ignore_wake = "GTCH7503:00@10",
 		},
 	},
+	{
+		/*
+		 * Spurious wakeups from the dGPU event pin (_AEI pin 4, handled
+		 * by _EVT -> Notify(\_SB.PCI0.GPP0.PEGP, 0x81)): the system
+		 * resumes from S3 immediately unless an external display is
+		 * driven by the dGPU. Lid wake uses the EC GPE and is unaffected.
+		 * Found in BIOS RLCN29WW, hybrid graphics mode.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "83LT"),
+		},
+		.driver_data = &(struct acpi_gpiolib_dmi_quirk) {
+			.ignore_wake = "AMDI0030:00@4",
+		},
+	},
 	{} /* Terminating entry */
 };
 

---
base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
change-id: 20261125-legion-gpio-wake-08d650123e78

Best regards,
--  
shorezero <shorezero@proton.me>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-26 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 15:43 [PATCH] gpiolib: acpi: Add ignore_wake quirk for Lenovo Legion Pro 5 16ADR10 shorezero via B4 Relay
2026-11-26 10:49 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox