Skip to content

rtc: macsmc: round the whole-second offset to the nearest second - #1045

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
fix/macsmc-rtc-round-offset
Nov 6, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
fix/macsmc-rtc-round-offset

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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_epoch ticks, against an NTP-synced clock.

  • Before (fleet16): rtc0 macsmc-rtc and rtc1 apple-pmu both +0.631 s ahead. chronyd stepped the clock back 1.0–1.8 s on 4 of the last 8 boots.
  • After the kernel's first RTC sync on rtc1: −0.372 s (= +0.631 − 1), inside the ±0.5 s bound.
  • Next boot on rtc1: no chronyd step. RTC still −0.37 s, SELinux enforcing, 0 AVC, no failed units. The only kernel warning is the existing ISAR2 override line.
  • Restored to fleet16 afterwards, test kernel removed, all entries pinned.
  • For reference, the tick-offset parts measure exact (M2 +0.002 s, J616s +0.003 s).

checkpatch: clean except the house From/Signed-off-by address difference.

🤖 Generated with Claude Code

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
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 6, 2026 16:59
@RyanTheTide
RyanTheTide merged commit ae2d2ca into aurora-wip Nov 6, 2026
@RyanTheTide
RyanTheTide deleted the fix/macsmc-rtc-round-offset branch November 6, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant