* [PATCH v1] PM: sleep: Call pm_restore_gfp_mask() after dpm_resume()
@ 2025-07-09 17:12 Rafael J. Wysocki
2025-07-09 19:58 ` Mario Limonciello
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-07-09 17:12 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Mario Limonciello
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Commit 12ffc3b1513e ("PM: Restrict swap use to later in the suspend
sequence") changed two pm_restore_gfp_mask() calls in enter_state()
and hibernation_restore() into one pm_restore_gfp_mask() call in
dpm_resume_end(), but it put that call before the dpm_resume()
invocation which is too early (some swap-backing devices may not be
ready at that point).
Moreover, this code ordering change was not even mentioned in the
changelog of the commit mentioned above.
Address this by moving that call after the dpm_resume() one.
Fixes: 12ffc3b1513e ("PM: Restrict swap use to later in the suspend sequence")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/base/power/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1254,8 +1254,8 @@
*/
void dpm_resume_end(pm_message_t state)
{
- pm_restore_gfp_mask();
dpm_resume(state);
+ pm_restore_gfp_mask();
dpm_complete(state);
}
EXPORT_SYMBOL_GPL(dpm_resume_end);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v1] PM: sleep: Call pm_restore_gfp_mask() after dpm_resume()
2025-07-09 17:12 [PATCH v1] PM: sleep: Call pm_restore_gfp_mask() after dpm_resume() Rafael J. Wysocki
@ 2025-07-09 19:58 ` Mario Limonciello
0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2025-07-09 19:58 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM; +Cc: LKML
On 7/9/2025 1:12 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Commit 12ffc3b1513e ("PM: Restrict swap use to later in the suspend
> sequence") changed two pm_restore_gfp_mask() calls in enter_state()
> and hibernation_restore() into one pm_restore_gfp_mask() call in
> dpm_resume_end(), but it put that call before the dpm_resume()
> invocation which is too early (some swap-backing devices may not be
> ready at that point).
>
> Moreover, this code ordering change was not even mentioned in the
> changelog of the commit mentioned above.
>
> Address this by moving that call after the dpm_resume() one.
>
> Fixes: 12ffc3b1513e ("PM: Restrict swap use to later in the suspend sequence")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/base/power/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -1254,8 +1254,8 @@
> */
> void dpm_resume_end(pm_message_t state)
> {
> - pm_restore_gfp_mask();
> dpm_resume(state);
> + pm_restore_gfp_mask();
> dpm_complete(state);
> }
> EXPORT_SYMBOL_GPL(dpm_resume_end);
>
>
>
Thanks, I looked through the codepaths and I agree with this change.
Thanks for catching it.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-09 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-09 17:12 [PATCH v1] PM: sleep: Call pm_restore_gfp_mask() after dpm_resume() Rafael J. Wysocki
2025-07-09 19:58 ` Mario Limonciello
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®