Skip to content

Commit 23b8851

Browse files
nfrapradoshuahkh
authored andcommitted
kselftest: cpufreq: Get rid of double suspend in rtcwake case
Commit 0b631ed ("kselftest: cpufreq: Add RTC wakeup alarm") added support for automatic wakeup in the suspend routine of the cpufreq kselftest by using rtcwake, however it left the manual power state change in the common path. The end result is that when running the cpufreq kselftest with '-t suspend_rtc' or '-t hibernate_rtc', the system will go to sleep and be woken up by the RTC, but then immediately go to sleep again with no wakeup programmed, so it will sleep forever in an automated testing setup. Fix this by moving the manual power state change so that it only happens when not using rtcwake. Link: https://lore.kernel.org/r/20250430-ksft-cpufreq-suspend-rtc-double-fix-v1-1-dc17a729c5a7@collabora.com Fixes: 0b631ed ("kselftest: cpufreq: Add RTC wakeup alarm") Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 8ffe772 commit 23b8851

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/cpufreq/cpufreq.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,10 @@ do_suspend()
251251
printf "Failed to suspend using RTC wake alarm\n"
252252
return 1
253253
fi
254+
else
255+
echo $filename > $SYSFS/power/state
254256
fi
255257

256-
echo $filename > $SYSFS/power/state
257258
printf "Came out of $1\n"
258259

259260
printf "Do basic tests after finishing $1 to verify cpufreq state\n\n"

0 commit comments

Comments
 (0)