Repository navigation
rtc: macsmc: round the whole-second offset to the nearest second - #1045
Merged
Merged
Conversation
On the parts that keep the RTC offset in whole seconds (the J700), the
clock's seconds tick with the 32768 Hz counter's. set_time() took the
counter down to whole seconds, so after a write the clock read up to a
whole second ahead of the time set. The Neo's RTC measured 0.63 s ahead
of NTP time, and chronyd stepped the system clock back 1.0 to 1.8 s on
most boots ("System clock wrong by -1.1 seconds").
Round the counter to the nearest second instead: the clock is then at
most half a second ahead or behind. The tick-offset parts are unchanged.
Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On parts that keep the RTC offset in whole seconds (the J700), the clock's seconds tick with the 32768 Hz counter's.
set_time()took the counter down to whole seconds, so after a write the clock read up to a whole second ahead of the time set.Change: round the counter to the nearest second, so the clock is at most half a second ahead or behind. The tick-offset parts (M1/M2/M4 Pro) are unchanged, and so is the alarm path, which compares counter seconds.
Hardware test, Neo: one-shot via the fleet kit's neo-install.sh. 7.3.0-aurora-rtc1 = fleet17 2661d71 + this commit, tree identical to this branch; os_uuid pin carried; saved_entry and /boot/dtb untouched. I measured the phase as the system time at which
/sys/class/rtc/rtcN/since_epochticks, against an NTP-synced clock.checkpatch: clean except the house From/Signed-off-by address difference.
🤖 Generated with Claude Code