Skip to content

Commit 68e2201

Browse files
committed
ACPI: EC: Dispatch the EC GPE directly on s2idle wake
On platforms where the Low Power S0 Idle _DSM interface is used, on wakeup from suspend-to-idle, when it is known that the ACPI SCI has triggered while suspended, dispatch the EC GPE in order to catch all EC events that may have triggered the wakeup before carrying out the noirq phase of device resume. That is needed to handle power button wakeup on some platforms where the EC goes into a low-power mode during suspend-to-idle and while in that mode it will discard events after a timeout. If that timeout is shorter than the time it takes to complete the noirq resume of devices, looking for EC events after the latter is too late. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reported-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Wendy Wang <wendy.wang@intel.com>
1 parent 7453645 commit 68e2201

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

drivers/acpi/ec.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,12 @@ void acpi_ec_unblock_transactions(void)
10341034
acpi_ec_start(first_ec, true);
10351035
}
10361036

1037+
void acpi_ec_dispatch_gpe(void)
1038+
{
1039+
if (first_ec)
1040+
acpi_dispatch_gpe(NULL, first_ec->gpe);
1041+
}
1042+
10371043
/* --------------------------------------------------------------------------
10381044
Event Management
10391045
-------------------------------------------------------------------------- */

drivers/acpi/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ int acpi_ec_ecdt_probe(void);
188188
int acpi_ec_dsdt_probe(void);
189189
void acpi_ec_block_transactions(void);
190190
void acpi_ec_unblock_transactions(void);
191+
void acpi_ec_dispatch_gpe(void);
191192
int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
192193
acpi_handle handle, acpi_ec_query_func func,
193194
void *data);

drivers/acpi/sleep.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,13 @@ static void acpi_s2idle_wake(void)
989989
!irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) {
990990
pm_system_cancel_wakeup();
991991
s2idle_wakeup = true;
992+
/*
993+
* On some platforms with the LPS0 _DSM device noirq resume
994+
* takes too much time for EC wakeup events to survive, so look
995+
* for them now.
996+
*/
997+
if (lps0_device_handle)
998+
acpi_ec_dispatch_gpe();
992999
}
9931000
}
9941001

0 commit comments

Comments
 (0)