[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h-FtZ3gOmP8yVFAbWFzNijRY0MHUxUnqtqBT+rvpwjOQ@mail.gmail.com>
Date: Wed, 12 Nov 2025 21:20:15 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Riwen Lu <luriwen@...inos.cn>
Cc: rafael@...nel.org, pavel@...nel.org, lenb@...nel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
xiongxin <xiongxin@...inos.cn>
Subject: Re: [PATCH v2] PM: suspend: Make pm_test delay interruptible by
wakeup events
On Thu, Nov 6, 2025 at 2:19 AM Riwen Lu <luriwen@...inos.cn> wrote:
>
> Modify the suspend_test() function to make the test delay can be
> interrupted by wakeup events.
>
> This improves the responsiveness of the system during suspend testing
> when wakeup events occur, allowing the suspend process to proceed
> without waiting for the full test delay to complete when wakeup events
> are detected.
>
> Additionally, using msleep() instead of mdelay() avoids potential soft
> lockup "CPU stuck" issues when long test delays are configured.
>
> Signed-off-by: Riwen Lu <luriwen@...inos.cn>
> Signed-off-by: xiongxin <xiongxin@...inos.cn>
This is confusing.
If you send somebody else's patch, there needs to be a From: header
pointing to them in addition to the S-o-b tag.
If you collaborated with somebody else on this patch, there needs to
be a Co-developed-by: tag pointing to them in addition to the S-o-b
tag.
If none of the above is the case, the additional S-o-b tag should not
be present.
Thanks!
> ---
> kernel/power/suspend.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index 4bb4686c1c08..a8e80ba8ac2c 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -344,10 +344,14 @@ MODULE_PARM_DESC(pm_test_delay,
> static int suspend_test(int level)
> {
> #ifdef CONFIG_PM_DEBUG
> + int i;
> +
> if (pm_test_level == level) {
> pr_info("suspend debug: Waiting for %d second(s).\n",
> pm_test_delay);
> - mdelay(pm_test_delay * 1000);
> + for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++)
> + msleep(1000);
> +
> return 1;
> }
> #endif /* !CONFIG_PM_DEBUG */
> --
> 2.25.1
>
Powered by blists - more mailing lists