From: Samuel Wu <wusamuel@google.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@kernel.org>, Len Brown <lenb@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>
Cc: Samuel Wu <wusamuel@google.com>,
kernel-team@android.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Saravana Kannan <saravanak@google.com>
Subject: [PATCH v3 1/3] PM: Make pm_wakeup_clear() call more clear
Date: Wed, 20 Aug 2025 17:42:33 -0700 [thread overview]
Message-ID: <20250821004237.2712312-2-wusamuel@google.com> (raw)
In-Reply-To: <20250821004237.2712312-1-wusamuel@google.com>
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().
With this patch, 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>
---
kernel/power/process.c | 1 -
kernel/power/suspend.c | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/power/process.c b/kernel/power/process.c
index dc0dfc349f22..8ff68ebaa1e0 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -132,7 +132,6 @@ int freeze_processes(void)
if (!pm_freezing)
static_branch_inc(&freezer_active);
- pm_wakeup_clear(0);
pm_freezing = true;
error = try_to_freeze_tasks(true);
if (!error)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index b4ca17c2fecf..4bb4686c1c08 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -595,6 +595,7 @@ static int enter_state(suspend_state_t state)
}
pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]);
+ pm_wakeup_clear(0);
pm_suspend_clear_flags();
error = suspend_prepare(state);
if (error)
--
2.51.0.261.g7ce5a0a67e-goog
next prev parent reply other threads:[~2025-08-21 0:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 0:42 [PATCH v3 0/3] PM: Support aborting suspend during filesystem sync Samuel Wu
2025-08-21 0:42 ` Samuel Wu [this message]
2025-09-04 19:06 ` [PATCH v3 1/3] PM: Make pm_wakeup_clear() call more clear Rafael J. Wysocki
2025-08-21 0:42 ` [PATCH v3 2/3] PM: Support aborting suspend during filesystem sync Samuel Wu
2025-09-04 19:22 ` Rafael J. Wysocki
2025-09-05 5:07 ` Saravana Kannan
2025-09-05 9:38 ` Rafael J. Wysocki
2025-09-09 1:41 ` Saravana Kannan
2025-08-21 0:42 ` [PATCH v3 3/3] PM: Support abort during fs_sync of back-to-back suspends Samuel Wu
2025-08-21 6:45 ` Saravana Kannan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250821004237.2712312-2-wusamuel@google.com \
--to=wusamuel@google.com \
--cc=dakr@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=saravanak@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®