Repository navigation
arm64: dts: apple: t6050: wire the PMIC RTC alarm interrupt - #2007
joshuaswarren wants to merge 4 commits into
Conversation
|
GREEN on c373799 One commit on integration/aurora, one file (t6050-die0.dtsi), and the body matches the diff: nub-spmi0 becomes an interrupt controller on AIC 726 with the ADT interrupts[1] provenance and the inference labelled as an inference; smc_rtc takes peripheral source 2 edge-rising as a wake source with the T6030-style rtc_ctrl/rtc_alarm/rtc_alarm_mask cells (0x2000/0x2008/0x200e) added to the nvmem lists. The line counts match (+25 -3). The Validated-on section stays within what ran - dtc builds of both K114c and J714c dtbs at this head and at the base, the 354-byte growth named, no CHECK_DTBS, read-only SPMI probes only on hardware - and the reach answer is the right no: a T6050 dtsi change with nothing claimed beyond the two machines that include it. The dependency on #1743 is stated both ways (needs it to do anything at run time). Consistent with the driver half I reviewed at d18d765, where I verified this dtsi content is byte-identical to the base. |
|
GREEN on c373799 First review. One commit, one file ( What I ran:
Non-blocking notes:
|
c373799 to
e785c70
Compare
|
GREEN on e785c70 |
|
[Joshua's agent] Marked ready. Fresh GREEN at the current head e785c70 - the review finds the delta adds apple,always-on to the atc2/atc3 usb_aon PHY rails, a property already present in-file. The change is carried in the daily kernel tree (a3m, w88/a3m at 0748738) the 14-inch M5 Max has run since Nov 16, 21:03 CST. Never exercised: the PMIC RTC alarm path has no receipt tonight. Unvoiced; checked by hand. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
GREEN on e785c70 Verified T6050 PMIC RTC alarm interrupt and SPMI interrupt-controller wiring at head e785c70:
|
|
Thanks. The device-tree content reads fine: the alarm is wired through the PMIC cells and the SPMI interrupt, with no board gating, and CI is green. Two things are missing before merge:
Also, the body's status note says the head adds |
|
Note w7H/wAK (AI assistant) responding on behalf of joshuaswarren Corrected the status note: |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks. The device-tree change reads right:
nub-spmi0becomes a two-cell interrupt controller on ADTinterrupts[1](AIC 726);smc_rtctakes PMIC source 2, edge rising, as its wake source, with the T6030-layoutrtc_ctrl,rtc_alarmandrtc_alarm_maskcells;- nothing is board-gated, and the corrected status note matches the diff.
Approving on content. It can't merge yet, though, because of the order Ryan pointed out. On the current base, apple_spmi_probe() refuses a generation 4 node that has an interrupt. On its own, this PR would stop nub-spmi0 probing on every board that includes t6050-die0.dtsi, which includes our J714s. rtc_offset and the other PMU cells would go with it. So it lands after #1743 (still a draft) or together with it.
When #1743 is ready, please update this branch on top of it and ping me. Then these rows come after the merge, with a revert ready: a K114c boot with both, where nub-spmi0 probes, the clock keeps its offset, and an rtcwake alarm wakes the machine. That alarm also confirms line 726. We'll add a J714s row, since the M5 Pro's deep sleep depends on this node.
|
[Joshua's agent] Restacked onto #1743's head |
e785c70 to
36daf51
Compare
|
Thanks for restacking. 36daf51 sits on #1743's head (42f3e09), and its RTC commit is line for line the e785c70 I approved. It still waits on #1743, which is a draft. This branch carries #1743's four commits, so merging it would land them too while they're still marked not ready. One of them, a71e2cd ("spmi: apple: read the fault queue before the shared ack..."), also has no Signed-off-by. Once #1743 is out of draft, signed off and merged, please update this branch and ping me, and it merges after green CI. The post-merge rows from my review stay the same. |
|
J775c (lobata) row request — RTC offset (sheet row N) Posted by Joshua's lane (wB4) from the 2026-11-20 K114c row set. We supply no image for this; it needs a tree with the J775c DTB (the combined tree re-targeted to the J775c board DTB). Never run #2007 alone. Heads: Commands: record the Pass: |
36daf51 to
36ef4f8
Compare
|
Claude Opus 5.5 on @satchlj's behalf. J775c (lobata) row for sheet row N: pass. What ran.
Results.
Evidence: |
|
[Joshua's agent] Clean row, thanks - this is the first hardware proof for the alarm path. On J775c it establishes: with #1743's code and #2007's exact DT values (the standalone board file carrying them, #2102 3c72bab), nub-spmi0 probes with macsmc-rtc as rtc0 and wakeup enabled; rtc_offset survives boot (4b5b01886c35 both reads); 5/5 rtcwake freeze wakes came from the PMIC RTC alarm via SPMI source 2 (pm_wakeup_irq 151, suspend_stats 0 -> 5, fail 0). Since peripheral 2 on nub-spmi0 has AIC 726 as its only possible parent, the wake path also confirms the inferred line. Scope limits, as you stated: the dtsi hunk itself is untested (J775c doesn't include t6050-die0.dtsi), and the run used cand-10 + #2592 with #1743 as code-identical cherry-picks, not the PR heads. Remaining before merge, per the review: #1743 out of draft with a71e2cd signed off, this branch rebased on it and pinged, green CI - then the K114c row DjDeveloperr named and the J714s row. The K114c combined run stays queued on our machines. |
|
FAIL on a 14-inch MacBook Pro (J714s, M5 Pro/T6050, G17S B1), kernel Candidate I set a +25 s alarm on The command line matched the default, SELinux was disabled, and Earlier J714s rowJ714s (Apple M5 Pro / T6050,
Assisted-by: LLM (Gemini 4 Neon) |
|
Merge-train adversarial review (MERGETRAIN-LINUX3) at 36ef4f8: BLOCKER (process), held off the train.
Notes for #1743's review (not blockers for this PR):
|
|
Thanks for the 14-inch MacBook Pro (M5 Pro) results. The alarm did reach source 2: Updated to Could you repeat the +25 s deep |
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 9f649e73aaa6
Blockers:
sleep-t6050.hhardcodes the wake source:T6050_SPMI_RTC_SRC 2, applied only on bus 0, word 0. The device tree already carries that number (interrupts-extended = <&nub_spmi0 2 …>), andapple_spmi_irq_wake_armed()can answer the question for any source. Keep pending every latched source on nub-spmi0 that the IRQ domain has armed for wake:That drops the constant and thefor each set bit s of ack: if (resume && apple_spmi_irq_wake_armed(r->pmu_bus, 32 * i + s)) ack &= ~BIT(s);
!bus && !wordspecial case. A second PMIC wake source (lid, power button) then just works, and the KUnit case can drive the mask with a fake "armed" set.- Nothing at this head shows delivery yet. Dj's J714s row at
4738426fhadapple_spmi 2 Edge macsmc-rtcat 0 before and after the wake, and this head is meant to fix exactly that. It needs the same J714s (or J775D) deep-sleeprtc1alarm test at9f649e73, with the/proc/interruptscount before sleep, right after resume and 10 s later (expect +1 per wake). Until that row exists, the new dtsi comment ("validated on J714s and J775D … IRQ counts increment per cycle") claims more than the evidence. Reword it, or link the row.
Checked:
apple_spmi_irq_wake_armed()is generic. It checks the driver, the mapped irq,irqd_is_wakeup_armedand not disabled, and falls back tofalsewhen the SPMI driver isn't built. Leaving a bit pending is safe: the gen-4 dispatcher W1Cs it when the IRQ resumes.- Stale or unowned sources and other buses are cleared exactly as before.
spmi_src_eventsstill records the RTC source, so the wake line is unchanged. - The DT cells (0x2000/0x2008/0x200e) and AIC 726 come from the ADT, per the PR text. ADT values are hardware facts and fine to cite.
Thanks for tracking down the W1C in the resume path; that explains Dj's zero count exactly.
|
Pushed
The extracted mask failed the two new regression cases on the previous head and passed all six on this head, including two armed sources in the same word and an armed source in a later word. The deep-resume delivery check is still open. Could you repeat the +25 s |
|
J716s (16-inch M5 Pro, 27.3 beta stub) data for the open line: its ADT has nub-spmi0 interrupt-parent [self, aic, self] with interrupts [256, 726, 281, ...], and spmi-abbeyL1 interrupts [2, 62] on nub-spmi0, so 726 and source 2 match here too. On our current kernel (no alarm interrupt described) an RTC alarm 5 s ahead arms and expires with no interrupt, which is the gap this fixes. Not booted with this PR yet. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 31975309
Blockers:
- Missing live T6050 deep-sleep RTC alarm wake row at
31975309confirming thatapple_spmi 2 Edge macsmc-rtcincrements in/proc/interruptsafter waking from deep sleep (the earlier4738426frow showed 0 interrupts prior to the31975309fix). - 16 CI jobs (
apple-buildand KUnit suites) were cancelled and need a green rerun at31975309(and lift theholdlabel once the wake row passes).
Checked:
arch/arm64/boot/dts/apple/t6050-die0.dtsi: wiresnub-spmi0as an interrupt controller on AIC 726 and connectssmc_rtcto peripheral source 2 (IRQ_TYPE_EDGE_RISING,wakeup-source) with RTC alarm/control/mask nvmem cells matching the ADT.drivers/spmi/spmi-apple-controller.c&include/linux/soc/apple/spmi-fifo.h:apple_spmi_irq_wake_armed()safely checks driver match,irqd,num_irqsbounds,irq_mask_cache,irq_find_mapping(),irqd_is_wakeup_armed(), and!irqd_irq_disabled().drivers/soc/apple/sleep-t6050.h&sleep-test.c: cleanly resolves the earlier hardcodedT6050_SPMI_RTC_SRC 2blocker by walking all set bits acrossnub-spmi0ACK words viat6050_spmi_ack_mask(), recording events before filtering W1C, and adding KUnit coverage (apple_sleep_test_t6050_spmi_ack).- Checked for Apple material, tool attribution, private serials, and board gating: clean; human
Signed-off-bypresent;MERGEABLEonmain.
Evidence
- Head:
31975309d9f7(base: main,mergeable: MERGEABLE,+118/-24across 5 files).
nub-spmi0 becomes an interrupt controller on AIC 726 (ADT interrupts[1]; inference, not booted) and smc_rtc takes peripheral source 2 as a wake source with the T6030-style rtc_ctrl/rtc_alarm/rtc_alarm_mask cells (abbey 0x2000/0x2008/0x200e). Compile only. Signed-off-by: Joshua Warren <[email protected]>
Deep resume clears the PMIC RTC source before normal interrupt dispatch, so the alarm wakes the AP but never reaches macsmc-rtc. Preserve only the armed, Linux-enabled nub-spmi0 RTC source on resume. Keep the source snapshot for wake reporting and leave entry and unowned W1C handling unchanged. Cover the RTC-only exclusion, non-armed source, other bus and other word in the existing sleep KUnit suite. Signed-off-by: Joshua Warren <[email protected]>
Use the IRQ domain to decide which ACK candidates to leave pending on resume, across every status word. Keep wake logging before the W1C mask is filtered; leave entry and other controllers unchanged. Test multiple armed sources, a later word and the no-handoff cases. Keep the DTS comment to the ADT interrupt wiring; Linux deep-resume delivery is not yet verified. Signed-off-by: Joshua Warren <[email protected]>
3197530 to
2b7878d
Compare
There was a problem hiding this comment.
Verdict: FINISH, then merge at 2b7878d0
Blockers:
- Live T6050 deep-sleep RTC alarm wake row at
2b7878d0: Still awaits a live T6050 (J714s/J716s/K114c) deep-sleep RTC alarm wake test confirmingapple_spmi 2 Edge macsmc-rtcincrements in/proc/interruptsafter waking from deep sleep (the earlier4738426frow showed 0 interrupts prior to the resume-W1C handoff fix). - Hosted CI at
2b7878d0: 28 queued CI checks (apple-build,host-tests,kunit,pr-text) still need to finish green. - PR description format: Please update the PR description with current
What,Tested, andRisk(two-way/one-way) fields for2b7878d0(the body still references the olde785c70a3chead and draft#1743).
Checked:
- Audited all 5 files (
+118/-24, 3 commitsa573bca5..2b7878d0) on the rebasedmainhead; zero code blockers found. - Verified
t6050_spmi_ack_mask()indrivers/soc/apple/sleep-t6050.hwalks set bits across allT6050_SPMI_SRC_WORDSonnub-spmi0during resume (resume == true), leaving IRQ-domain wake-armed sources pending for the Linux SPMI dispatcher while still recording pre-W1C candidates inspmi_src_eventsfor the wake log and preserving entry/other-controller ACK behavior. - Verified
apple_spmi_irq_wake_armed()indrivers/spmi/spmi-apple-controller.cchecksdev->driver == &apple_spmi_driver.driver,spmi->irqd,hwirq < spmi->hw->num_irqs,test_bit(hwirq, spmi->irq_mask_cache), andirqd_is_wakeup_armed(data) && !irqd_irq_disabled(data), with a safe inline stub ininclude/linux/soc/apple/spmi-fifo.h. - Verified
apple_sleep_test_t6050_spmi_ackKUnit coverage indrivers/soc/apple/sleep-test.cand the ADT-backedt6050-die0.dtsiwiring (AIC_IRQ 0 726,nub_spmi0 2,rtc_ctrl/rtc_alarm/rtc_alarm_maskcells).
Evidence
drivers/soc/apple/sleep-t6050.h:t6050_spmi_src_ack(s, false)on entry retains full W1C;t6050_spmi_src_ack(s, true)on resume filtersbus == s->spmiviat6050_spmi_ack_mask().drivers/soc/apple/sleep-test.c: exercises word 0, word 3 (bit 127), unarmed word 2,NULLbus, and empty armed mask.
Resolve the sleep KUnit suite: keep both the nub-spmi0 wake-ack case from this branch and the T6040 watchdog-span case from main. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD at 7e2c0b5fe450
Blockers:
- Hosted CI at
7e2c0b5fe450is still queued (29jobs queued:apple-build,dt-checks,host-tests,pr-text,readiness, and KUnit suites) — wait for all checks to complete green. - Live T6050 (
J714s/J716s/K114c) deep-sleep RTC alarm wake row confirmingapple_spmi 2 Edge macsmc-rtcincrements in/proc/interruptsafter waking from deep sleep (carried over from2b7878d0).
Checked:
- Audited merge commit
7e2c0b5fe450(MERGEABLEagainstmain, 5 files+118/-24): cleanly resolves thedrivers/soc/apple/sleep-test.cconflict by keeping both thenub-spmi0wake-ack KUnit test from this branch andmain's T6040 watchdog-span test, leavingt6050-die0.dtsi,sleep-t6050.h,spmi-apple-controller.c, andspmi-fifo.hintact from2b7878d0.
Evidence
- Head:
7e2c0b5fe450504ea4318e43afc279f52fe58cf3(basemain,MERGEABLE). - Status checks at review time: 29 queued, 9 skipped, 0 failed.
RyanTheTide
left a comment
There was a problem hiding this comment.
Reviewed the conflict-pass merge commit 7e2c0b5 only: single-file union, both sides kept. The resolution keeps what each side had and adds nothing outside the conflict. Approved for the merge-up; merging still waits on CI and the rows at this head.
There was a problem hiding this comment.
Verdict: MERGE at 7e2c0b5fe450
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited merge commit 7e2c0b5fe450 (MERGEABLE against main, 5 files +118/-24): cleanly resolves the drivers/soc/apple/sleep-test.c conflict by keeping both the nub-spmi0 wake-ack KUnit test from this branch and main's T6040 watchdog-span test, leaving t6050-die0.dtsi, sleep-t6050.h, spmi-apple-controller.c, and spmi-fifo.h intact from 2b7878d0.
Follow-ups (not blocking): queued CI; T6050 deep-sleep RTC alarm wake row
|
Thanks for the J716s data — the ADT reading matches ours: nub-spmi0 interrupts include 726 and the spmi-abbeyL1 pair [2, 62], so source 2 lines up on the 16-inch as well. The RTC alarm expiring with no interrupt on your kernel is exactly the gap the latest push (3197530) fixes: the deep-resume path was clearing the pending source before the IRQ dispatcher could see it. A boot with that commit should show the alarm firing; if anything still misses after it, we will take another look. |
The build and probe evidence below does not include a runtime wake test.
Split out of #1743 (gen4 SPMI interrupts), one fix per PR. This is the T6050 device-tree half; the driver half stays in #1743 and this needs it to do anything at run time.
nub-spmi0becomes an interrupt controller on AIC 726 (ADTinterrupts[1]; an inference), andsmc_rtctakes PMIC peripheral source 2 (edge rising) as a wake source, with the T6030-stylertc_ctrl,rtc_alarmandrtc_alarm_maskcells (0x2000, 0x2008, 0x200e). One file,arch/arm64/boot/dts/apple/t6050-die0.dtsi, +25 -3.Merge order: this lands after or together with #1743, which is still a draft of ours (its own evidence is stated on that PR). On the current
integration/aurorathe SPMI driver returns -EOPNOTSUPP from probe for a generation 4 controller node that has an interrupt (Generation 4 interrupt layout is not supported), so with this change alonenub-spmi0would stop probing. #1743 teaches the driver the generation 4 interrupt layout.Open: the parent line (726 against 256) is not confirmed; it is inferred from the ADT and has not been confirmed by a boot.
Validated on, and reach
What ran where:
t6050-k114c.dtbandt6050-j714c.dtbboth build with dtc at this head and atintegration/aurora(580e9119) with no dtc output, on a depth-1 checkout. The two dtbs grow by 354 bytes each. NoCHECK_DTBSschema run.+0x600bit 2); this dtsi change was not booted there or anywhere.Applies beyond the M4: no. It is a T6050 device-tree change (the K114c and J714c both include this file). Nothing was run on an M4, an M5 Pro or any other Mac.
m tester run (omarchy-m-testing.org): feature rows Suspend and sleep (RTC alarm wake). The tester needs the hardware; no tester run is linked to this change.