Skip to content

Commit 2ea1940

Browse files
committed
Merge tag 'pm-5.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fix from Rafael Wysocki: "This makes a recently introduced suspend-to-idle wakeup issue on Dell XPS13 9360 go away" * tag 'pm-5.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: EC: PM: Avoid flushing EC work when EC GPE is inactive
2 parents 8e2b7f6 + 607b9df commit 2ea1940

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

drivers/acpi/ec.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,9 +2016,13 @@ bool acpi_ec_dispatch_gpe(void)
20162016
* to allow the caller to process events properly after that.
20172017
*/
20182018
ret = acpi_dispatch_gpe(NULL, first_ec->gpe);
2019-
if (ret == ACPI_INTERRUPT_HANDLED)
2019+
if (ret == ACPI_INTERRUPT_HANDLED) {
20202020
pm_pr_dbg("EC GPE dispatched\n");
20212021

2022+
/* Flush the event and query workqueues. */
2023+
acpi_ec_flush_work();
2024+
}
2025+
20222026
return false;
20232027
}
20242028
#endif /* CONFIG_PM_SLEEP */

drivers/acpi/sleep.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -980,13 +980,6 @@ static int acpi_s2idle_prepare_late(void)
980980
return 0;
981981
}
982982

983-
static void acpi_s2idle_sync(void)
984-
{
985-
/* The EC driver uses special workqueues that need to be flushed. */
986-
acpi_ec_flush_work();
987-
acpi_os_wait_events_complete(); /* synchronize Notify handling */
988-
}
989-
990983
static bool acpi_s2idle_wake(void)
991984
{
992985
if (!acpi_sci_irq_valid())
@@ -1018,16 +1011,15 @@ static bool acpi_s2idle_wake(void)
10181011
return true;
10191012

10201013
/*
1021-
* Cancel the wakeup and process all pending events in case
1014+
* Cancel the SCI wakeup and process all pending events in case
10221015
* there are any wakeup ones in there.
10231016
*
10241017
* Note that if any non-EC GPEs are active at this point, the
10251018
* SCI will retrigger after the rearming below, so no events
10261019
* should be missed by canceling the wakeup here.
10271020
*/
10281021
pm_system_cancel_wakeup();
1029-
1030-
acpi_s2idle_sync();
1022+
acpi_os_wait_events_complete();
10311023

10321024
/*
10331025
* The SCI is in the "suspended" state now and it cannot produce
@@ -1060,7 +1052,8 @@ static void acpi_s2idle_restore(void)
10601052
* of GPEs.
10611053
*/
10621054
acpi_os_wait_events_complete(); /* synchronize GPE processing */
1063-
acpi_s2idle_sync();
1055+
acpi_ec_flush_work(); /* flush the EC driver's workqueues */
1056+
acpi_os_wait_events_complete(); /* synchronize Notify handling */
10641057

10651058
s2idle_wakeup = false;
10661059

0 commit comments

Comments
 (0)