]> www.infradead.org Git - users/dwmw2/linux.git/commit
um: rtc: use RTC time when calculating the alarm
authorBenjamin Berg <benjamin.berg@intel.com>
Tue, 17 Dec 2024 20:49:06 +0000 (21:49 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 10 Jan 2025 12:50:00 +0000 (13:50 +0100)
commit579e7fd383ff3f7a4f685489f8fe18cfd8659074
treefeef61e31fb2de558cd7eb0427f20efacd31652e
parent7ee1e43a5f493a1332af3ac668cc2a87515c1622
um: rtc: use RTC time when calculating the alarm

The kernel realtime and the current RTC time may have a (small) offset.
Should the kernel time be slightly in the future, then the timeout is
zero. This is problematic in time-travel mode, as a zero timeout can be
correctly configured and time never advances.

Replace the kernel realtime read with a read of the actual persistent
RTC clock. Also, for time-travel, calculate the exact nanoseconds needed
for the clock to advance.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Co-developed-by: Avraham Stern <avraham.stern@intel.com>
Link: https://patch.msgid.link/20241217204906.1408011-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/drivers/rtc_kern.c