PM: suspend: Clear events_check_enabled on early error
Subsystems (2)
PATCH 1/1 PM: suspend: Clear events_check_enabled on early error
On an early error in enter_state(), such as during filesystem sync, prepare notifiers, or freezer, events_check_enabled is not cleared and is left on outside a suspend window. This means wakeup sources' wakeup counts are erroneously incremented outside a suspend window.
Clear events_check_enabled at the Unlock label to handle early errors. Keep clearing events_check_enabled at the Finish label so that wakeup_count is not incremented during a normal resume path.
Fixes 95b982b45122 ("PM / s2idle: Clear the events_check_enabled flag")
Signed-off-by Samuel Wu <[email protected]>
--- kernel/power/suspend.c | 1 + 1 file changed, 1 insertion(+)
kernel/power/suspend.c +1 -0
@@ -626,6 +626,7 @@ static int enter_state(suspend_state_t state)pm_pr_dbg ("Finishing wakeup.\n" );suspend_finish (); Unlock: + events_check_enabled = false;mutex_unlock (&system_transition_mutex);return error; }
Signature · 1 line
2.56.1.839.g22a8290db9-goog