Skip to content

Commit f75447c

Browse files
committed
PM: hibernate: Fix hybrid-sleep
JIRA: https://issues.redhat.com/browse/RHEL-109250 commit 469d80a Author: Mario Limonciello (AMD) <superm1@kernel.org> Date: Thu Sep 25 13:51:06 2025 -0500 Hybrid sleep will hibernate the system followed by running through the suspend routine. Since both the hibernate and the suspend routine will call pm_restrict_gfp_mask(), pm_restore_gfp_mask() must be called before starting the suspend sequence. Add an explicit call to pm_restore_gfp_mask() to power_down() before the suspend sequence starts. Add an extra call for pm_restrict_gfp_mask() when exiting suspend so that the pm_restore_gfp_mask() call in hibernate() is balanced. Reported-by: Ionut Nechita <ionut_n2001@yahoo.com> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4573 Tested-by: Ionut Nechita <ionut_n2001@yahoo.com> Fixes: 12ffc3b ("PM: Restrict swap use to later in the suspend sequence") Tested-by: Kenneth Crudup <kenny@panix.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Link: https://patch.msgid.link/20250925185108.2968494-2-superm1@kernel.org [ rjw: Add comment explainig the new pm_restrict_gfp_mask() call purpose ] Cc: 6.16+ <stable@vger.kernel.org> # 6.16+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 3e5988c commit f75447c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/power/hibernate.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,16 @@ static void power_down(void)
658658

659659
#ifdef CONFIG_SUSPEND
660660
if (hibernation_mode == HIBERNATION_SUSPEND) {
661+
pm_restore_gfp_mask();
661662
error = suspend_devices_and_enter(mem_sleep_current);
662663
if (error) {
663664
hibernation_mode = hibernation_ops ?
664665
HIBERNATION_PLATFORM :
665666
HIBERNATION_SHUTDOWN;
666667
} else {
668+
/* Match pm_restore_gfp_mask() call in hibernate() */
669+
pm_restrict_gfp_mask();
670+
667671
/* Restore swap signature. */
668672
error = swsusp_unmark();
669673
if (error)

0 commit comments

Comments
 (0)