Skip to content

Commit 4b7d654

Browse files
storulfrafaeljw
authored andcommitted
PM: s2idle: Extend comment in s2idle_enter()
The s2idle_lock must be held while checking for a pending wakeup and while moving into S2IDLE_STATE_ENTER, to make sure a wakeup doesn't get lost. Let's extend the comment in the code to make this clear. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://patch.msgid.link/20250311160827.1129643-3-ulf.hansson@linaro.org [ rjw: Rewrote the new comment ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0f42194 commit 4b7d654

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/power/suspend.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ static void s2idle_enter(void)
9595
* The correctness of the code below depends on the number of online
9696
* CPUs being stable, but CPUs cannot be taken offline or put online
9797
* while it is running.
98+
*
99+
* The s2idle_lock must be acquired before the pending wakeup check to
100+
* prevent pm_system_wakeup() from running as a whole between that check
101+
* and the subsequent s2idle_state update in which case a wakeup event
102+
* would get lost.
98103
*/
99-
100104
raw_spin_lock_irq(&s2idle_lock);
101105
if (pm_wakeup_pending())
102106
goto out;

0 commit comments

Comments
 (0)