diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2025-03-11 17:08:23 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-03-12 21:14:53 +0100 |
commit | 4b7d654258e0dd69a7d00be387b388f9d7544912 (patch) | |
tree | 5d708866dfaa40b7e4a6d0fea1834a3841323479 | |
parent | 0f42194c6b22d687fd53c8aea5413cf976366672 (diff) |
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>
-rw-r--r-- | kernel/power/suspend.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 1876abf1be15..6fae1e0a331c 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -95,8 +95,12 @@ static void s2idle_enter(void) * The correctness of the code below depends on the number of online * CPUs being stable, but CPUs cannot be taken offline or put online * while it is running. + * + * The s2idle_lock must be acquired before the pending wakeup check to + * prevent pm_system_wakeup() from running as a whole between that check + * and the subsequent s2idle_state update in which case a wakeup event + * would get lost. */ - raw_spin_lock_irq(&s2idle_lock); if (pm_wakeup_pending()) goto out; |