From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Riwen Lu <luriwen@kylinos.cn>,
pavel@kernel.org, lenb@kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, xiongxin <xiongxin@kylinos.cn>,
regressions@lists.linux.dev
Subject: [REGRESSION] Re: [PATCH v3] PM: suspend: Make pm_test delay interruptible by wakeup events
Date: Tue, 23 Dec 2025 22:08:54 +0100 [thread overview]
Message-ID: <aUsAk0k1N9hw8IkY@venus> (raw)
In-Reply-To: <CAJZ5v0hwhVO6J2nS2-byU0+Lm8QbzdBzv4-X4eLNNUpTg+41Kg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4735 bytes --]
Hi,
On Fri, Nov 14, 2025 at 05:11:16PM +0100, Rafael J. Wysocki wrote:
> On Thu, Nov 13, 2025 at 2:26 AM Riwen Lu <luriwen@kylinos.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.
> >
> > Co-developed-by: xiongxin <xiongxin@kylinos.cn>
> > Signed-off-by: xiongxin <xiongxin@kylinos.cn>
> > Signed-off-by: Riwen Lu <luriwen@kylinos.cn>
> > ---
> > 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 b4ca17c2fecf..1c2f777da367 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 */
> > --
>
> Applied as 6.19 material, thanks!
This is now upstream as a10ad1b10402 ("PM: suspend: Make pm_test delay interruptible by wakeup events").
When doing the following PM debugging test on ROCK 4D on v6.19-rc2
echo N > /sys/module/printk/parameters/console_suspend
echo 1 > /sys/power/pm_print_times
echo 1 > /sys/power/pm_debug_messages
echo core > /sys/power/pm_test
echo mem > /sys/power/state
I see the following error triggered reliably, which did not happen on 6.18
and no longer appears after reverting this patch:
[ 49.647656] ------------[ cut here ]------------
[ 49.647656] WARNING: kernel/time/timekeeping.c:821 at ktime_get+0xb8/0xd8, CPU#0: swapper/0/0
[ 49.647656] Modules linked in: sha256 cfg80211 binfmt_misc fuse ipv6 snd_soc_hdmi_codec rk805_pwrkey rockchip_saradc dwmac_rk stmmac_platform rtc_hym8563 snd_soc_es8328_i2c phy_rockchip_usbdp rockchipdrm stmmac snd_soc_es8328 dw_hdmi_qp industrialio_triggered_buffer analogix_dp typec phy_rockchip_samsung_hdptx kfifo_buf dw_dp rockchip_thermal dw_mipi_dsi spi_rockchip_sfc phy_rockchip_naneng_combphy pcs_xpcs panfrost drm_shmem_helper gpu_sched snd_soc_rockchip_sai snd_soc_simple_card drm_dp_aux_bus dw_hdmi snd_soc_simple_card_utils rfkill_gpio rfkill snd_soc_core drm_display_helper snd_compress cec drm_client_lib drm_dma_helper display_connector snd_pcm_dmaengine drm_kms_helper snd_pcm drm snd_timer snd backlight soundcore adc_keys
[ 49.647656] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.19.0-rc2-g7211b2cf9c08 #1 PREEMPT
[ 49.647656] Hardware name: Radxa ROCK 4D (DT)
[ 49.647656] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 49.647656] pc : ktime_get+0xb8/0xd8
[ 49.647656] lr : tick_nohz_idle_enter+0x50/0x90
[ 49.647656] sp : ffffc1a17b573d50
[ 49.647656] x29: ffffc1a17b573d50 x28: 00000000fdf57ec0 x27: ffffc1a17b57b260
[ 49.647656] x26: ffffc1a17b57e000 x25: 0000000000000000 x24: 00000000000000ea
[ 49.647656] x23: ffffc1a17a470000 x22: ffffc1a17b57ad00 x21: ffff3e6282a25000
[ 49.647656] x20: ffff0003fdead5d8 x19: ffffc1a17b4885d8 x18: 000000000000000a
[ 49.647656] x17: ffff3e6282a25000 x16: ffff800080000000 x15: 00700ea231d1d404
[ 49.647656] x14: 0000000000000396 x13: 0000000000000001 x12: 0000000000000001
[ 49.647656] x11: 00000000000000c0 x10: 0000000000000aa0 x9 : ffffc1a17b573d00
[ 49.647656] x8 : ffffc1a17b586680 x7 : 0000000000000000 x6 : 0000000000000000
[ 49.647656] x5 : 0000000000000004 x4 : ffffc1a17b57eb68 x3 : 0000000000000000
[ 49.647656] x2 : ffffc1a17b48ec40 x1 : 0000000000000000 x0 : 0000000000000001
[ 49.647656] Call trace:
[ 49.647656] ktime_get+0xb8/0xd8 (P)
[ 49.647656] tick_nohz_idle_enter+0x50/0x90
[ 49.647656] do_idle+0x38/0x260
[ 49.647656] cpu_startup_entry+0x38/0x40
[ 49.647656] rest_init+0xd8/0xe0
[ 49.647656] console_on_rootfs+0x0/0x6c
[ 49.647656] __primary_switched+0x88/0x90
[ 49.647656] ---[ end trace 0000000000000000 ]---
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next parent reply other threads:[~2025-12-23 21:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251113012638.1362013-1-luriwen@kylinos.cn>
[not found] ` <CAJZ5v0hwhVO6J2nS2-byU0+Lm8QbzdBzv4-X4eLNNUpTg+41Kg@mail.gmail.com>
2025-12-23 21:08 ` Sebastian Reichel [this message]
2025-12-24 11:44 ` [REGRESSION] Re: [PATCH v3] PM: suspend: Make pm_test delay interruptible by wakeup events Rafael J. Wysocki
2025-12-25 9:33 ` luriwen
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=aUsAk0k1N9hw8IkY@venus \
--to=sebastian.reichel@collabora.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=luriwen@kylinos.cn \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=regressions@lists.linux.dev \
--cc=xiongxin@kylinos.cn \
/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