Skip to contentSkip to conversation

PM: suspend: Clear events_check_enabled on early error

PATCH New Samuel Wu 1 participant 1 message Nov 29

Subsystems (2)
lore
Share & tools
lore

Samuel Wu

author
#0 lore raw

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")
---
 kernel/power/suspend.c | 1 +
 1 file changed, 1 insertion(+)
kernel/power/suspend.c +1 -0
index 32c055df02da..d91593f9a3cf 100644
@@ -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