[PATCH] wakealarm: skip the reset check when RTC time earlier than current system time
Ivan Hu
ivan.hu at canonical.com
Mon Sep 22 06:56:46 UTC 2025
BugLink: https://bugs.launchpad.net/fwts/+bug/2121796
When using RTC_ALM_SET, the kernel forces the alarm to use the current
day/month/year and will wrap it into the next day if the requested time
is earlier than the current system time. This causes wakealarm_test5 to
fail. Skip this case when encountering an earlier RTC setting.
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
src/acpi/wakealarm/wakealarm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c
index 89512540..7833dad8 100644
--- a/src/acpi/wakealarm/wakealarm.c
+++ b/src/acpi/wakealarm/wakealarm.c
@@ -146,6 +146,14 @@ static int wakealarm_test5(fwts_framework *fw)
rtc_tm.tm_mday, rtc_tm.tm_mon + 1,
rtc_tm.tm_year + 1900, rtc_tm.tm_hour,
rtc_tm.tm_min, rtc_tm.tm_sec);
+ } else if (rtc_now.tm_hour == rtc_tm.tm_hour &&
+ rtc_now.tm_min == rtc_tm.tm_min &&
+ rtc_now.tm_sec == rtc_tm.tm_sec) {
+ fwts_skipped(fw,
+ "The kernel adjusted the RTC_ALM_SET alarm by up to 24 hours "
+ "because the requested time was earlier than the current time. "
+ "This behavior ensures the alarm always points to a future time.");
+ return FWTS_SKIP;
} else {
fwts_failed(fw, LOG_LEVEL_MEDIUM,
"WakeAlarmNotResetTest5",
--
2.43.0
More information about the fwts-devel
mailing list