mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] PM: sleep: Call pm_restore_gfp_mask() after dpm_resume()
Date: Wed, 9 Jul 2025 15:58:19 -0400	[thread overview]
Message-ID: <21c6f554-fbbf-4856-823f-f58c9956f8ef@amd.com> (raw)
In-Reply-To: <2797018.mvXUDI8C0e@rjwysocki.net>

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>

      reply	other threads:[~2025-07-09 19:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 17:12 Rafael J. Wysocki
2025-07-09 19:58 ` Mario Limonciello [this message]

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=21c6f554-fbbf-4856-823f-f58c9956f8ef@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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®