* [PATCH] PM: suspend: Clear events_check_enabled on early error
@ 2026-11-29 3:52 Samuel Wu
0 siblings, 0 replies; only message in thread
From: Samuel Wu @ 2026-11-29 3:52 UTC (permalink / raw)
To: Rafael J. Wysocki, Pavel Machek, Len Brown, Rajat Jain
Cc: Samuel Wu, kernel-team, Pavel Machek, Rafael J. Wysocki, linux-pm
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 <wusamuel@google.com>
---
kernel/power/suspend.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 32c055df02da..d91593f9a3cf 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -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;
}
--
2.56.1.839.g22a8290db9-goog
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-29 3:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 3:52 [PATCH] PM: suspend: Clear events_check_enabled on early error Samuel Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox