mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zihuan Zhang <zhangzihuan@kylinos.cn>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
	Christian Brauner <brauner@kernel.org>
Cc: Len Brown <len.brown@intel.com>, Pavel Machek <pavel@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] PM: suspend: clean up redundant filesystems_freeze/thaw handling
Date: Mon, 14 Jul 2025 16:44:26 +0800	[thread overview]
Message-ID: <9d35035d-c63e-4d11-a403-54c50e8b35c1@kylinos.cn> (raw)
In-Reply-To: <20250712030824.81474-1-zhangzihuan@kylinos.cn>

Hi Rafael,

Just a gentle ping on this patch.

I realized I forgot to mention an important motivation in the changelog:
calling filesystems_freeze() twice (from both suspend_prepare() and 
enter_state()) lead to a black screen and make the system unable to resume..

This patch avoids the duplicate call and resolves that issue.

在 2025/7/12 11:08, Zihuan Zhang 写道:
> The recently introduced support for freezing filesystems during system
> suspend included calls to filesystems_freeze() in both suspend_prepare()
> and enter_state(), as well as calls to filesystems_thaw() in both
> suspend_finish() and the Unlock path in enter_state(). These are
> redundant.
>
> - filesystems_freeze() is already called in suspend_prepare(), which is
>    the proper and consistent place to handle pre-suspend operations. The
> second call in enter_state() is unnecessary and removed.
>
> - filesystems_thaw() is invoked in suspend_finish(), which covers
>    successful suspend/resume paths. In the failure case , we add a call
> to filesystems_thaw() only when needed, avoiding the duplicate call in
> the general Unlock path.
>
> This change simplifies the suspend code and avoids repeated freeze/thaw
> calls, while preserving correct ordering and behavior.
>
> Fixes: eacfbf74196f91e4c26d9f8c78e1576c1225cd8c ("power: freeze filesystems during suspend/resume")
> Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
> ---
>   kernel/power/suspend.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index bb608b68fb30..8f3e4c48d5cd 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -384,6 +384,7 @@ static int suspend_prepare(suspend_state_t state)
>   		return 0;
>   
>   	dpm_save_failed_step(SUSPEND_FREEZE);
> +	filesystems_thaw();
>   	pm_notifier_call_chain(PM_POST_SUSPEND);
>    Restore:
>   	pm_restore_console();
> @@ -593,8 +594,6 @@ static int enter_state(suspend_state_t state)
>   		ksys_sync_helper();
>   		trace_suspend_resume(TPS("sync_filesystems"), 0, false);
>   	}
> -	if (filesystem_freeze_enabled)
> -		filesystems_freeze();
>   
>   	pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]);
>   	pm_suspend_clear_flags();
> @@ -614,7 +613,6 @@ static int enter_state(suspend_state_t state)
>   	pm_pr_dbg("Finishing wakeup.\n");
>   	suspend_finish();
>    Unlock:
> -	filesystems_thaw();
>   	mutex_unlock(&system_transition_mutex);
>   	return error;
>   }
Thanks,
Zihuan Zhang

  reply	other threads:[~2025-07-14  8:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-12  3:08 Zihuan Zhang
2025-07-14  8:44 ` Zihuan Zhang [this message]
2025-07-14 17:57   ` Rafael J. Wysocki
2025-07-15  6:12     ` Zihuan Zhang
2025-07-15 12:48       ` Rafael J. Wysocki
2025-07-16  2:04         ` Zihuan Zhang
2025-07-16 12:23           ` Rafael J. Wysocki
2025-07-17  0:37             ` Zihuan Zhang

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=9d35035d-c63e-4d11-a403-54c50e8b35c1@kylinos.cn \
    --to=zhangzihuan@kylinos.cn \
    --cc=brauner@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@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®