mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
PM / suspend: Clear wakeups before running PM callbacks
PM callbacks can be used as an indicator that the system is suspending, and as such, a wakeup may be issued outside the notifier in order to cancel an ongoing suspend. Clearing wakeups after running the PM callbacks can thus cause wakeups to be missed. Fix it by simply clearing wakeups prior to running PM callbacks. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
5f732a69cb
commit
1a58d5951e
@ -137,7 +137,6 @@ int freeze_processes(void)
|
||||
if (!pm_freezing)
|
||||
atomic_inc(&system_freezing_cnt);
|
||||
|
||||
pm_wakeup_clear(true);
|
||||
pr_debug("Freezing user space processes ... ");
|
||||
pm_freezing = true;
|
||||
error = try_to_freeze_tasks(true);
|
||||
|
@ -571,6 +571,7 @@ static int enter_state(suspend_state_t state)
|
||||
if (!mutex_trylock(&pm_mutex))
|
||||
return -EBUSY;
|
||||
|
||||
pm_wakeup_clear(true);
|
||||
if (state == PM_SUSPEND_TO_IDLE)
|
||||
s2idle_begin();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user