From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH v1 1/2] PM: hibernate: Restrict GFP mask in power_down()
Date: Fri, 26 Sep 2025 18:40:25 +0200 [thread overview]
Message-ID: <8625379.NyiUUSuA9g@rafael.j.wysocki> (raw)
In-Reply-To: <3303305.5fSG56mABF@rafael.j.wysocki>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Commit 12ffc3b1513e ("PM: Restrict swap use to later in the
suspend sequence") caused hibernation_platform_enter() to call
pm_restore_gfp_mask() via dpm_resume_end(), so when power_down()
returns after aborting hibernation_platform_enter(), it needs
to match the pm_restore_gfp_mask() call in hibernate() that will
occur subsequently.
Address this by adding a pm_restrict_gfp_mask() call to the relevant
error path in power_down().
Fixes: 12ffc3b1513e ("PM: Restrict swap use to later in the suspend sequence")
Cc: 6.16+ <stable@vger.kernel.org> # 6.16+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
kernel/power/hibernate.c | 2 ++
1 file changed, 2 insertions(+)
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -733,6 +733,8 @@ static void power_down(void)
case HIBERNATION_PLATFORM:
error = hibernation_platform_enter();
if (error == -EAGAIN || error == -EBUSY) {
+ /* Match pm_restore_gfp_mask() in hibernate(). */
+ pm_restrict_gfp_mask();
swsusp_unmark();
events_check_enabled = false;
pr_info("Wakeup event detected during hibernation, rolling back.\n");
next prev parent reply other threads:[~2025-09-26 16:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 16:37 [PATCH v1 0/2] PM: hibernate: Fix GFP mask restoration issue and consolidate code Rafael J. Wysocki
2025-09-26 16:40 ` Rafael J. Wysocki [this message]
2025-09-26 16:47 ` [PATCH v1 1/2] PM: hibernate: Restrict GFP mask in power_down() Mario Limonciello
2025-09-26 16:41 ` [PATCH v1 2/2] PM: hibernate: Combine return paths " Rafael J. Wysocki
2025-09-26 18:29 ` Mario Limonciello
2025-09-26 18:31 ` Rafael J. Wysocki
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=8625379.NyiUUSuA9g@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.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