PM / wakeup: Avoid excessive s2idle wake attempts in pm_system_wakeup()

Calling s2idle_wake() once after pm_abort_suspend is incremented is all
that's needed to wake up from s2idle. Avoid multiple unnecessary attempts
to wake from s2idle by only doing the wakeup when pm_abort_suspend hits 1.
The s2idle machinery already provides the synchronization needed to make
this safe.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Change-Id: I789857351353737f7199a8df5c5ba210050352e6
fourteen
Sultan Alsawaf 3 years ago committed by Jenna
parent c09e657655
commit 5e0188e271
  1. 4
      drivers/base/power/wakeup.c

@ -965,8 +965,8 @@ bool pm_wakeup_pending(void)
void pm_system_wakeup(void) void pm_system_wakeup(void)
{ {
atomic_inc(&pm_abort_suspend); if (atomic_inc_return_relaxed(&pm_abort_suspend) == 1)
s2idle_wake(); s2idle_wake();
} }
EXPORT_SYMBOL_GPL(pm_system_wakeup); EXPORT_SYMBOL_GPL(pm_system_wakeup);

Loading…
Cancel
Save