Skip to content

arm64: dts: apple: alias SMC RTC as rtc0 ahead of read-only PMU RTC - #3482

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/dts-apple-rtc-aliases
Nov 28, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/dts-apple-rtc-aliases

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What

Fixes #3254.

Where an Apple SoC exposes both the writable SMC RTC (apple,smc-rtc) and a read-only PMU RTC (apple,t8112/t8122/t6041/t6050-pmu-rtc, which lacks .set_time), omitting rtc0/rtc1 aliases leaves rtc0 / hctosys assignment to probe order. On T8122 (J613/J615), apple-pmu-rtc registers first as rtc0, causing hwclock --systohc to fail with -EINVAL.

  • Label the T8122 SMC RTC node smc_rtc and add rtc0 = &smc_rtc; rtc1 = &pmu_rtc; in t8122.dtsi (covers J613, J615, J504, J433, J434).
  • Add rtc0 = &smc_rtc; rtc1 = &pmu_rtc; in t6040.dtsi and t6041.dtsi (fixes t6041-j575c.dts and deduplicates t604x-j614-j616.dtsi and t6040-j773s.dts).
  • Add rtc0 = &smc_rtc; rtc1 = &pmu_rtc; in t6050-j714s-sleep.dtsi, t6050-j716c-sleep.dtsi, and t6050-k114-k116.dtsi (covers all T6050 boards exposing pmu_rtc).
  • Deduplicate t8112 per-board aliases into t8112.dtsi.
  • Keep t8140-j700.dts unchanged (rtc0 = &pmu_rtc), since Baku's PMU RTC implements .set_time.

Tested

  • Build & DT checks at 321b3719a58e92: make ARCH=arm64 dtbs W=1 (0 new warnings), fdtget verified /aliases/rtc0 and /aliases/rtc1 on every compiled T8122, T6040, T6041, T6050, T8112, and T8140 DTB, scripts/checkpatch.pl (0 errors, 0 warnings).
  • J615 (MacBook Air 15" M3, T8122) guarded DT-only aura-try row on production 7.3.0-aurora-fleet90-airs2 (default cmdline; live Stage 2 dd01f13c with only /aliases/rtc0 and rtc1 matching 321b3719a58e92 t8122-j615.dtb, candidate c2ffbd9e, traces/boot/20261128-linux3482-rtc-aliases/):
    • Baseline: rtc0=apple-pmu-rtc (hctosys=1), rtc1=macsmc-rtc, hwclock --systohc FAILED (ioctl(RTC_SET_TIME): Invalid argument, rc=1).
    • Trial (boot_id=48421d1d): rtc0=macsmc-rtc (hctosys=1, system clock set from macsmc-rtc), rtc1=apple-pmu-rtc (wakealarm=yes), hwclock --systohc PASS (rc=0), rtcwake -d rtc1 -m mem -s 15 PASS (suspend_stats/success 0 -> 1, post-wake rtc0=macsmc-rtc hctosys=1), settled smoke VERDICT PASS (Enforcing, 0 failed units). Production restored cleanly (boot_id=613d67d6).
  • J413 (MacBook Air 13" M2, T8112) peer-family guarded aura-try row on production 7.3.0-aurora-fleet89 (boot_id=e07c4412, traces/boot/20261128-aura557-linux3482-j413/): rtc0=/soc/smc@23e400000/rtc (macsmc-rtc, hctosys=1), rtc1=/soc/spmi@23d714000/pmic@e/rtc (apple-pmu-rtc, wakealarm=yes), hwclock --systohc PASS (rc=0), settled smoke VERDICT PASS (Enforcing, failed=[], kerr=0). Production restored cleanly (boot_id=cbff1021).

Risk

Risk: two-way door affecting rtc0/rtc1 numbering on T8122 (J613, J615, J504, J433, J434), T6041 (J575c), and T6050 (J714s, J716c, K114s/c, K116s/c). Because macsmc-rtc does not implement wakealarm while apple-pmu-rtc does, callers that invoke rtcwake with its default /dev/rtc0 on those boards will need -d rtc1 (matching existing T8112 and T6040 behavior); kernel alarmtimer and systemd select a wake-capable RTC automatically (CLOCK_BOOTTIME_ALARM is unaffected). T8112 and existing T6040/T6041 laptop/mini DTBs preserve the exact same rtc0/rtc1 paths; T8140 is untouched.

Not yet

  • CI completion and final review approval before merge.
Compiled DTB /aliases verification
t8122-j433.dtb               rtc0=/soc/smc@2ec400000/rtc                     rtc1=/soc/spmi@2e4714000/pmic@e/rtc
t8122-j434.dtb               rtc0=/soc/smc@2ec400000/rtc                     rtc1=/soc/spmi@2e4714000/pmic@e/rtc
t8122-j504.dtb               rtc0=/soc/smc@2ec400000/rtc                     rtc1=/soc/spmi@2e4714000/pmic@e/rtc
t8122-j613.dtb               rtc0=/soc/smc@2ec400000/rtc                     rtc1=/soc/spmi@2e4714000/pmic@e/rtc
t8122-j615.dtb               rtc0=/soc/smc@2ec400000/rtc                     rtc1=/soc/spmi@2e4714000/pmic@e/rtc
t6041-j575c.dtb              rtc0=/smc@50c600000/rtc                         rtc1=/spmi@509014000/pmic@b/rtc
t6040-j616s.dtb              rtc0=/smc@50c600000/rtc                         rtc1=/spmi@509014000/pmic@e/rtc
t6040-j773s.dtb              rtc0=/smc@50c600000/rtc                         rtc1=/spmi@509014000/pmic@e/rtc
t6050-j714s.dtb              rtc0=/soc@200000000/smc@28c600000/rtc           rtc1=/soc@200000000/spmi@28a014000/pmic@e/rtc
t6050-j716c.dtb              rtc0=/soc@200000000/smc@28c600000/rtc           rtc1=/soc@200000000/spmi@28a014000/pmic@e/rtc
t6050-k114s.dtb              rtc0=/soc@200000000/smc@28c600000/rtc           rtc1=/soc@200000000/spmi@28a014000/pmic@e/rtc
t6050-k116s.dtb              rtc0=/soc@200000000/smc@28c600000/rtc           rtc1=/soc@200000000/spmi@28a014000/pmic@e/rtc
t8112-j413.dtb               rtc0=/soc/smc@23e400000/rtc                     rtc1=/soc/spmi@23d714000/pmic@e/rtc
t8112-j473.dtb               rtc0=/soc/smc@23e400000/rtc                     rtc1=/soc/spmi@23d714000/pmic@e/rtc
t8140-j700.dtb               rtc0=/soc/spmi@308714000/pmic@e/rtc             rtc1=/soc/smc@30c600000/rtc

Where an Apple SoC exposes both the writable SMC RTC (apple,smc-rtc) and
a read-only PMU RTC (apple,t8112/t8122/t6041/t6050-pmu-rtc, which has no
.set_time callback), missing rtc aliases leave rtc0/hctosys assignment to
probe order. On T8122 (for example J613) the PMU RTC probes first and
claims rtc0, causing default hwclock --systohc to fail with -EINVAL
(#3254).

Label the T8122 SMC RTC node as smc_rtc and add rtc0 = &smc_rtc and
rtc1 = &pmu_rtc aliases in the shared SoC/family dtsi files that define
both RTCs:
- t8122.dtsi (covers J613, J615, J504, J433, J434)
- t6040.dtsi and t6041.dtsi (adds missing aliases for t6041-j575c and
  deduplicates t604x-j614-j616.dtsi / t6040-j773s.dts)
- t6050-j714s-sleep.dtsi, t6050-j716c-sleep.dtsi, and
  t6050-k114-k116.dtsi (covers all T6050 boards exposing pmu_rtc)
- t8112.dtsi (deduplicates the per-board aliases in j413/j415/j473/j493)

T8140 (t8140-j700.dts) is unchanged because its Baku PMU RTC supports
set_time and intentionally stays rtc0.

Fixes: #3254
Signed-off-by: Ryan Murray <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 321b3719

Blockers: none in the change. Before merge:

  1. Hardware rows (already in Not yet): J615 at this head with rtc0 = macsmc-rtc and hctosys=1, hwclock --systohc succeeding, and a peer-family boot.
  2. Wake side effect, worth a line in Risk and a check in the row. On the boards whose numbering changes (T8122, T6041 J575c, T6050), rtc0 moves from the PMU RTC to the SMC RTC. Our own J473 row (M3-DEEPSLEEP, linux#3413) recorded that the macsmc rtc0 has no wakealarm, while the PMU RTC (rtc1) does. rtcwake and anything else that defaults to /dev/rtc0 for a wake alarm will therefore stop working on J615/J613 after this change, and needs -d rtc1, as on T8112/T6040 today. The kernel's alarmtimer and systemd pick a wake-capable RTC by themselves, so CLOCK_BOOTTIME_ALARM users are not affected. In the J615 row, run rtcwake -d rtc1 -m mem -s 15 (a short sleep) to show the PMU wake alarm still works on rtc1, and tell the sleep-kit owners about the new device number.

Checked: This matches the numbering T8112 and T6040 already use (rtc0 = &smc_rtc; rtc1 = &pmu_rtc), and moves it to the SoC dtsi files, so the boards gain one rule instead of per-board copies. Both RTC drivers implement .read_time. Only macsmc and the T8140 seconds-ops PMU RTC implement .set_time, so T8140 J700 rightly keeps rtc0 = &pmu_rtc. The PR's fdtget table shows rtc0/rtc1 resolving to the SMC and PMU nodes on every T8122, T6040, T6041 and T6050 DTB. The RTC core reads the rtc alias from the device's or its parent's OF node, which is how the existing T8112/T6040 aliases already take effect. No chip if-gates, DT only. No attribution.

Evidence and note
  • Read at 321b3719: the full DT diff, drivers/rtc/rtc-macsmc.c macsmc_rtc_ops (line 345) and drivers/rtc/rtc-apple-pmu.c apple_pmu_rtc_ops/apple_pmu_rtc_seconds_ops (lines 430-441), and issue #3254.
  • Lab evidence for the wake note: lanes/M3-DEEPSLEEP.md, 05:30 row ("rtc1 = apple-pmu-rtc; rtc0 macsmc has no wakealarm").
  • Style, not blocking: the T6050 J716c aliases sit in t6050-j716c-sleep.dtsi. The SoC or board dtsi that defines smc_rtc/pmu_rtc would be easier to find.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Addressed both items from review at 321b3719a58e92:

  1. Primary T8122 (J615) + peer-family T8112 (J413) hardware rows completed (default cmdline, guarded one-shot aura-try, both restored cleanly):
    • J615 (T8122, 7.3.0-aurora-fleet90-airs2, DT-only swap adding only /aliases/rtc0 and rtc1 matching 321b3719a58e92, candidate c2ffbd9e):
      • Baseline (dd01f13c): rtc0=apple-pmu-rtc (hctosys=1), rtc1=macsmc-rtc, hwclock --systohc failed (ioctl(RTC_SET_TIME): Invalid argument, rc=1).
      • Trial (boot_id=48421d1d): rtc0=macsmc-rtc (hctosys=1, kernel set system clock from macsmc-rtc), rtc1=apple-pmu-rtc (wakealarm=yes), hwclock --systohc succeeded (ioctl(RTC_SET_TIME) was successful, rc=0), rtcwake -d rtc1 -m mem -s 15 succeeded (suspend_stats/success 0 -> 1, woke on rtc1), settled smoke VERDICT PASS (Enforcing, failed=[]).
      • Evidence: traces/boot/20261128-linux3482-rtc-aliases/.
    • J413 (T8112, 7.3.0-aurora-fleet89, boot_id=e07c4412):
      • Verified /aliases/rtc0=/soc/smc@23e400000/rtc (macsmc-rtc, hctosys=1), /aliases/rtc1=/soc/spmi@23d714000/pmic@e/rtc (apple-pmu-rtc, wakealarm=yes), hwclock --systohc PASS (rc=0), settled smoke VERDICT PASS (Enforcing, failed=[], kerr=0).
      • Evidence: traces/boot/20261128-aura557-linux3482-j413/.
  2. Wake side effect: added the rtcwake /dev/rtc0 -> -d rtc1 note to the PR Risk section and notified the M3 deep-sleep owners (lanes/M3-DEEPSLEEP.md).

cc @DjDeveloperr @satchlj for DT visibility/review.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) blast:neo Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 321b3719: ready to merge

Check Detail
CI at head ok 5 checks passed
Review ok approved by satchlj
Requested changes ok none
Hardware row at head ok in the PR body at 321b3719
Conflicts ok none
PR text ok Risk: two-way · affecting rtc0/rtc1 numbering on T8122 (J613, J615, J504, J433, J434), T6041 (J575c), and T6050 (J714s, J716c, K114s/c, K116s/c). Because macsmc-rtc does not implement wakealarm while apple-pmu-rtc does, callers that invoke rtcwake with its default /dev/rtc0 on those boards will need -d rtc1 (matching existing T8112 and T6040 behavior); kernel alarmtimer and systemd select a wake-capable RTC automatically (CLOCKBOOTTIMEALARM is unaffected). T8112 and existing T6040/T6041 laptop/mini DTBs preserve the exact same rtc0/rtc1 paths; T8140 is untouched.

Areas: area:bringup, area:platform
Merge: gh pr merge 3482 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review PASS at 321b3719a5.

Verified:

  • Moving rtc0 = &smc_rtc and rtc1 = &pmu_rtc aliases into the SoC .dtsi / sleep .dtsi files (and removing redundant per-board duplicates while labeling smc_rtc: rtc in t8122.dtsi) consistently puts the writable SMC RTC ahead of the read-only PMU RTC across Apple SoC families.
  • Signed-off-by present.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) ci-failing A check failed at the PR head (bot) labels Nov 28, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J413 M2 Air (T8112) regression row at 321b3719a58e925bd707b832fe01d447a2e4d683 PASS. The guarded fleet89 trial carried the exact RTC alias values, reported macsmc-rtc as rtc0 with hctosys=1 and the wake-capable PMU as rtc1, and passed hwclock --systohc and settled smoke. Saved fleet89 was restored. This records the existing J413 row in the PR description with its exact alias-source head.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 321b371.

Checked: J615 and J413 receipts cover the exact RTC aliases, writable rtc0 and wake-capable rtc1, and both saved boots were restored. J615 also completed RTC suspend and wake. The PR now documents the explicit rtc1 requirement for rtcwake on affected boards. Hosted readiness passed and the current-main preview preserves the alias paths.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging at 321b3719. satchlj (code owner) and the review App approved at this head, and every code check is green (only the readiness summary is pending). Rows at this head: J615 + J413. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 4ffd63a into main Nov 28, 2026
8 of 14 checks passed
@RyanTheTide
RyanTheTide deleted the fix/dts-apple-rtc-aliases branch November 28, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) blast:neo Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T8122 (J613): read-only PMU RTC becomes rtc0/hctosys, so hwclock --systohc fails with EINVAL

2 participants