Re: [PATCH] rtc: class: Do not inject sleep time without a suspend snapshot
From: Ивайло Трухчев
Date: Fri Nov 13 2026 - 14:25:03 EST
Hi,
I hit the same jump independently on different hardware, so here is
another data point for this patch.
Samsung Galaxy Book4 (NP750XGK, Core i3-1315U, BIOS P09CFP.023),
Fedora 44, kernel 7.3.3-200.fc44.x86_64, s2idle only, RTC in local
time at UTC+2. The CPU has constant_tsc and nonstop_tsc but not
nonstop_tsc_s3, so the CMOS clock is the only source of sleep time.
After a 27 minute s2idle sleep the clock came back exactly two hours
ahead. chronyd did not step it back, because its makestep limit only
covers the first updates after start. With pm_debug_messages enabled,
the bad cycle shows three wakeups from IRQ 9 within about 0.2 seconds,
the last freeze too short for the CMOS clock to advance, and then
rtc_resume() injecting the UTC offset:
PM: suspend entry (s2idle)
rtc rtc0: PM: rtc_suspend returned 0 after 0 usecs
Timekeeping suspended for 1618.173 seconds
PM: Triggering wakeup from IRQ 9
ACPI: EC: ACPI EC work flushed
PM: Triggering wakeup from IRQ 9
PM: Triggering wakeup from IRQ 9
ACPI: EC: ACPI EC work flushed
ACPI: EC: 0 stale EC events cleared
Timekeeping suspended for 7200.407 seconds
rtc rtc0: PM: rtc_resume returned 0 after 1490 usecs
PM: suspend exit
In the normal cycles there is a single wakeup and rtc_resume returns
after 0 usecs. The extra wakeups are EC events from opening the lid.
They became more frequent here after I shortened the resume delay of
the Samsung EC quirk (ec_event_clearing=query and ec_delay=100 set at
runtime), and that is when I first saw the jump.
Your analysis matches what I found reading v7.3.3: rtc_suspend()
returns early because of the persistent clock, so old_rtc and
old_system are still zero when rtc_resume() runs.
I have not tested the patch itself. Keeping the RTC in UTC hides the
problem here.
The analysis and this mail were drafted with the help of an AI
assistant; the logs are from my own laptop.
Thanks,
Ivaylo