public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	Riwen Lu <luriwen@kylinos.cn>
Subject: Re: [PATCH v1] PM: sleep: Fix suspend_test() at the TEST_CORE level
Date: Sat, 27 Dec 2025 15:18:16 +0100	[thread overview]
Message-ID: <aU_p-0fVKR7z-vtH@venus> (raw)
In-Reply-To: <6251576.lOV4Wx5bFT@rafael.j.wysocki>

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

Hi,

On Fri, Dec 26, 2025 at 02:50:57PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit a10ad1b10402 ("PM: suspend: Make pm_test delay interruptible by
> wakeup events") replaced mdelay() in suspend_test() with msleep() which
> does not work at the TEST_CORE test level that calls suspend_test()
> while running on one CPU with interrupts off.
> 
> Address this by making suspend_test() check if the test level is
> suitable for using msleep() and use mdelay() otherwise.
> 
> Fixes: a10ad1b10402 ("PM: suspend: Make pm_test delay interruptible by wakeup events")
> Reported-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> Closes: https://lore.kernel.org/linux-pm/aUsAk0k1N9hw8IkY@venus/
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---

I can confirm it fixes the issue I reported, so:

Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Greetings,

-- Sebastian

>  kernel/power/suspend.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -349,9 +349,12 @@ static int suspend_test(int level)
>  	if (pm_test_level == level) {
>  		pr_info("suspend debug: Waiting for %d second(s).\n",
>  				pm_test_delay);
> -		for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++)
> -			msleep(1000);
> -
> +		for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++) {
> +			if (level > TEST_CORE)
> +				msleep(1000);
> +			else
> +				mdelay(1000);
> +		}
>  		return 1;
>  	}
>  #endif /* !CONFIG_PM_DEBUG */
> 
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-12-27 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26 13:50 [PATCH v1] PM: sleep: Fix suspend_test() at the TEST_CORE level Rafael J. Wysocki
2025-12-27 14:18 ` Sebastian Reichel [this message]
2025-12-29  2:31 ` luriwen
2025-12-29 13:32   ` Rafael J. Wysocki

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=aU_p-0fVKR7z-vtH@venus \
    --to=sebastian.reichel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luriwen@kylinos.cn \
    --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