Skip to content

Commit 56a232d

Browse files
wusamuel6rafaeljw
authored andcommitted
PM: sleep: Make pm_wakeup_clear() call more clear
Move pm_wakeup_clear() to the same location as other functions that do bookkeeping prior to suspend_prepare(). Since calling pm_wakeup_clear() is a prerequisite to setting up for suspend and enabling functionalities of suspend (like aborting during suspend), moving pm_wakeup_clear() higher up the call stack makes its intent more clear and obvious that it is called prior to suspend_prepare(). After this change, there is a slightly larger window when abort events can be registered, but otherwise suspend functionality is the same. Suggested-by: Saravana Kannan <saravanak@google.com> Signed-off-by: Samuel Wu <wusamuel@google.com> Link: https://patch.msgid.link/20250821004237.2712312-2-wusamuel@google.com Reviewed-by: Saravana Kannan <saravanak@google.com> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 98da8a4 commit 56a232d

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

kernel/power/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ int freeze_processes(void)
132132
if (!pm_freezing)
133133
static_branch_inc(&freezer_active);
134134

135-
pm_wakeup_clear(0);
136135
pm_freezing = true;
137136
error = try_to_freeze_tasks(true);
138137
if (!error)

kernel/power/suspend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ static int enter_state(suspend_state_t state)
595595
}
596596

597597
pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]);
598+
pm_wakeup_clear(0);
598599
pm_suspend_clear_flags();
599600
error = suspend_prepare(state);
600601
if (error)

0 commit comments

Comments
 (0)