Skip to contentSkip to conversation

PM: suspend: Drop a misplaced pm_restore_gfp_mask() call

PATCH In review Rafael J. Wysocki 2 participants 2 messages Jul 10, 2025 – Jul 11, 2025

Subsystems (2)
lore
Share & tools
lore

Rafael J. Wysocki

author maintainer
#0 lore raw

PATCH 1/1 PM: suspend: Drop a misplaced pm_restore_gfp_mask() call

From: Rafael J. Wysocki <[email protected]>

The pm_restore_gfp_mask() call added by commit 12ffc3b1513e ("PM:
Restrict swap use to later in the suspend sequence") to suspend_devices_and_enter() is done too early because it takes place before calling dpm_resume() in dpm_resume_end() and some swap-backing devices may not be ready at that point. Moreover, it is not even necessary because dpm_resume_end() called subsequently in the same code path invokes that function again.

Drop the misplaced pm_restore_gfp_mask() call from suspend_devices_and_enter() to address this issue.

Fixes 12ffc3b1513e ("PM: Restrict swap use to later in the suspend sequence")
---
 kernel/power/suspend.c |    1 -
 1 file changed, 1 deletion(-)
kernel/power/suspend.c +0 -1
@@ -540,7 +540,6 @@
 	return error;
 
  Recover_platform:
-	pm_restore_gfp_mask();
 	platform_recover(state);
 	goto Resume_devices;
 }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

The pm_restore_gfp_mask() call added by commit 12ffc3b1513e ("PM:
Restrict swap use to later in the suspend sequence") to suspend_devices_and_enter() is done too early because it takes place before calling dpm_resume() in dpm_resume_end() and some swap-backing devices may not be ready at that point. Moreover, it is not even necessary because dpm_resume_end() called subsequently in the same code path invokes that function again.

Drop the misplaced pm_restore_gfp_mask() call from suspend_devices_and_enter() to address this issue.

Fixes 12ffc3b1513e ("PM: Restrict swap use to later in the suspend sequence")
---
  kernel/power/suspend.c |    1 -
  1 file changed, 1 deletion(-)

kernel/power/suspend.c line 545

Quoted 7 lines
kernel/power/suspend.c +0 -1
@@ -540,7 +540,6 @@
  	return error;
 
   Recover_platform:
-	pm_restore_gfp_mask();
  	platform_recover(state);
  	goto Resume_devices;
  }