[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250311160827.1129643-3-ulf.hansson@linaro.org>
Date: Tue, 11 Mar 2025 17:08:23 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: "Rafael J . Wysocki" <rafael@...nel.org>,
linux-pm@...r.kernel.org
Cc: Len Brown <len.brown@...el.com>,
Pavel Machek <pavel@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 2/2] 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@...aro.org>
---
Changes in v2:
- New patch. Suggested by Rafael.
---
kernel/power/suspend.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 90fb06ca07d2..b7aa1db278ff 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -91,8 +91,12 @@ static void s2idle_enter(void)
{
trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true);
- /* CPUs can't be hotplugged here so let's not protect for it. */
-
+ /*
+ * 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. Note also that CPUs can't be hotplugged here so let's not
+ * protect for it.
+ */
raw_spin_lock_irq(&s2idle_lock);
if (pm_wakeup_pending())
goto out;
--
2.43.0
Powered by blists - more mailing lists