Skip to content

Commit d6ebb17

Browse files
superm1rafaeljw
authored andcommitted
ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems"
Testing on various upcoming OEM systems shows commit 7b167c4 ("ACPI: PM: Only mark EC GPE for wakeup on Intel systems") was short sighted and the symptoms were indicative of other problems. Some OEMs do have the dedicated GPIOs for the power button but also rely upon an interrupt to the EC SCI to let the lid work. The original commit showed spurious activity on Lenovo systems: * On both Lenovo T14 and P14s the keyboard wakeup doesn't work, and sometimes the power button event doesn't work. This was confirmed on my end at that time. However further development in the kernel showed that the issue was actually the IRQ for the GPIO controller was also shared with the EC SCI. This was actually fixed by commit 2d54067 ("pinctrl: amd: Fix wakeups when IRQ is shared with SCI"). The original commit also showed problems with AC adapter: * On HP 635 G7 detaching or attaching AC during suspend will cause the system not to wakeup * On Asus vivobook to prevent detaching AC causing resume problems * On Lenovo 14ARE05 to prevent detaching AC causing resume problems * On HP ENVY x360 to prevent detaching AC causing resume problems Detaching AC adapter causing problems appears to have been a problem because the EC SCI went off to notify the OS of the power adapter change but the SCI was ignored and there was no other way to wake up this system since GPIO controller wasn't properly enabled. The wakeups were fixed by enabling the GPIO controller in commit acd47b9 ("pinctrl: amd: Handle wake-up interrupt"). I've confirmed on a variety of OEM notebooks with the following test 1) echo 1 | sudo tee /sys/power/pm_debug_messages 2) sudo systemctl suspend 3) unplug AC adapter, make sure system is still asleep 4) wake system from lid (which is provided by ACPI SCI on some of them) 5) dmesg a) see the EC GPE dispatched, timekeeping for X seconds (matching ~time until AC adapter plug out) b) see timekeeping for Y seconds until woke (matching ~time from AC adapter until lid event) 6) Look at /sys/kernel/debug/amd_pmc/s0ix_stats "Time (in us) in S0i3" = X + Y - firmware processing time Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent dfd42fa commit d6ebb17

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/acpi/x86/s2idle.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,15 +424,11 @@ static int lps0_device_attach(struct acpi_device *adev,
424424
mem_sleep_current = PM_SUSPEND_TO_IDLE;
425425

426426
/*
427-
* Some Intel based LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U don't
428-
* use intel-hid or intel-vbtn but require the EC GPE to be enabled while
429-
* suspended for certain wakeup devices to work, so mark it as wakeup-capable.
430-
*
431-
* Only enable on !AMD as enabling this universally causes problems for a number
432-
* of AMD based systems.
427+
* Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the
428+
* EC GPE to be enabled while suspended for certain wakeup devices to
429+
* work, so mark it as wakeup-capable.
433430
*/
434-
if (!acpi_s2idle_vendor_amd())
435-
acpi_ec_mark_gpe_for_wake();
431+
acpi_ec_mark_gpe_for_wake();
436432

437433
return 0;
438434
}

0 commit comments

Comments
 (0)