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
urubino
Sultan Alsawaf 2 years ago committed by Jenna-they-them
parent 58dcdf0bc6
commit 142f75f083
  1. 4
      drivers/base/power/wakeup.c

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

Loading…
Cancel
Save