Skip to content

Commit 684d3b2

Browse files
committed
PM: sleep: Fix suspend_test() at the TEST_CORE level
Commit a10ad1b ("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: a10ad1b ("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> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://patch.msgid.link/6251576.lOV4Wx5bFT@rafael.j.wysocki
1 parent 9448598 commit 684d3b2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

kernel/power/suspend.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,12 @@ static int suspend_test(int level)
349349
if (pm_test_level == level) {
350350
pr_info("suspend debug: Waiting for %d second(s).\n",
351351
pm_test_delay);
352-
for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++)
353-
msleep(1000);
354-
352+
for (i = 0; i < pm_test_delay && !pm_wakeup_pending(); i++) {
353+
if (level > TEST_CORE)
354+
msleep(1000);
355+
else
356+
mdelay(1000);
357+
}
355358
return 1;
356359
}
357360
#endif /* !CONFIG_PM_DEBUG */

0 commit comments

Comments
 (0)