lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251017095338.4122406-1-luriwen@kylinos.cn>
Date: Fri, 17 Oct 2025 17:53:38 +0800
From: Riwen Lu <luriwen@...inos.cn>
To: rafael@...nel.org,
	pavel@...nel.org,
	lenb@...nel.org
Cc: linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Riwen Lu <luriwen@...inos.cn>,
	xiongxin <xiongxin@...inos.cn>
Subject: [PATCH v1] PM: suspend: Make pm_test delay interruptible by wakeup events

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 complte 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>
---
 kernel/power/suspend.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 4bb4686c1c08..8f022d279635 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -344,10 +344,18 @@ 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",
+		for (i = 0; i < pm_test_delay; i++) {
+			if (pm_wakeup_pending())
+				break;
+			msleep(1000);
+		}
+		if (i == pm_test_delay)
+			pr_info("suspend debug: Already wait %d second(s).\n",
 				pm_test_delay);
-		mdelay(pm_test_delay * 1000);
+
 		return 1;
 	}
 #endif /* !CONFIG_PM_DEBUG */
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ