Repository navigation
arm64: dts: apple: alias SMC RTC as rtc0 ahead of read-only PMU RTC - #3482
Conversation
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]>
There was a problem hiding this comment.
Verdict: FINISH, then merge at 321b3719
Blockers: none in the change. Before merge:
- Hardware rows (already in Not yet): J615 at this head with
rtc0= macsmc-rtc andhctosys=1,hwclock --systohcsucceeding, and a peer-family boot. - Wake side effect, worth a line in Risk and a check in the row. On the boards whose numbering changes (T8122, T6041 J575c, T6050),
rtc0moves from the PMU RTC to the SMC RTC. Our own J473 row (M3-DEEPSLEEP, linux#3413) recorded that the macsmcrtc0has nowakealarm, while the PMU RTC (rtc1) does.rtcwakeand anything else that defaults to/dev/rtc0for 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, soCLOCK_BOOTTIME_ALARMusers are not affected. In the J615 row, runrtcwake -d rtc1 -m mem -s 15(a short sleep) to show the PMU wake alarm still works onrtc1, 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.cmacsmc_rtc_ops(line 345) anddrivers/rtc/rtc-apple-pmu.capple_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 definessmc_rtc/pmu_rtcwould be easier to find.
|
Addressed both items from review at
cc @DjDeveloperr @satchlj for DT visibility/review. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Code review PASS at 321b3719a5.
Verified:
- Moving
rtc0 = &smc_rtcandrtc1 = &pmu_rtcaliases into the SoC.dtsi/ sleep.dtsifiles (and removing redundant per-board duplicates while labelingsmc_rtc: rtcint8122.dtsi) consistently puts the writable SMC RTC ahead of the read-only PMU RTC across Apple SoC families. Signed-off-bypresent.
|
J413 M2 Air (T8112) regression row at |
There was a problem hiding this comment.
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.
|
Merging at |
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), omittingrtc0/rtc1aliases leavesrtc0/hctosysassignment to probe order. On T8122 (J613/J615),apple-pmu-rtcregisters first asrtc0, causinghwclock --systohcto fail with-EINVAL.smc_rtcand addrtc0 = &smc_rtc; rtc1 = &pmu_rtc;int8122.dtsi(covers J613, J615, J504, J433, J434).rtc0 = &smc_rtc; rtc1 = &pmu_rtc;int6040.dtsiandt6041.dtsi(fixest6041-j575c.dtsand deduplicatest604x-j614-j616.dtsiandt6040-j773s.dts).rtc0 = &smc_rtc; rtc1 = &pmu_rtc;int6050-j714s-sleep.dtsi,t6050-j716c-sleep.dtsi, andt6050-k114-k116.dtsi(covers all T6050 boards exposingpmu_rtc).t8112per-board aliases intot8112.dtsi.t8140-j700.dtsunchanged (rtc0 = &pmu_rtc), since Baku's PMU RTC implements.set_time.Tested
321b3719a58e92:make ARCH=arm64 dtbs W=1(0 new warnings),fdtgetverified/aliases/rtc0and/aliases/rtc1on every compiled T8122, T6040, T6041, T6050, T8112, and T8140 DTB,scripts/checkpatch.pl(0 errors, 0 warnings).aura-tryrow on production7.3.0-aurora-fleet90-airs2(default cmdline; live Stage 2dd01f13cwith only/aliases/rtc0andrtc1matching321b3719a58e92t8122-j615.dtb, candidatec2ffbd9e,traces/boot/20261128-linux3482-rtc-aliases/):rtc0=apple-pmu-rtc(hctosys=1),rtc1=macsmc-rtc,hwclock --systohcFAILED (ioctl(RTC_SET_TIME): Invalid argument,rc=1).boot_id=48421d1d):rtc0=macsmc-rtc(hctosys=1, system clock set frommacsmc-rtc),rtc1=apple-pmu-rtc(wakealarm=yes),hwclock --systohcPASS (rc=0),rtcwake -d rtc1 -m mem -s 15PASS (suspend_stats/success0 -> 1, post-wakertc0=macsmc-rtc hctosys=1), settled smokeVERDICT PASS(Enforcing, 0 failed units). Production restored cleanly (boot_id=613d67d6).aura-tryrow on production7.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 --systohcPASS (rc=0), settled smokeVERDICT PASS(Enforcing,failed=[],kerr=0). Production restored cleanly (boot_id=cbff1021).Risk
Risk: two-way door affecting
rtc0/rtc1numbering on T8122 (J613, J615, J504, J433, J434), T6041 (J575c), and T6050 (J714s, J716c, K114s/c, K116s/c). Becausemacsmc-rtcdoes not implementwakealarmwhileapple-pmu-rtcdoes, callers that invokertcwakewith its default/dev/rtc0on those boards will need-d rtc1(matching existing T8112 and T6040 behavior); kernelalarmtimerand systemd select a wake-capable RTC automatically (CLOCK_BOOTTIME_ALARMis unaffected). T8112 and existing T6040/T6041 laptop/mini DTBs preserve the exact samertc0/rtc1paths; T8140 is untouched.Not yet
Compiled DTB /aliases verification