Skip to content

rtc: apple-pmu: enable T8103 (Sera) PMU RTC and 192-vector nub-spmi interrupt - #2714

Merged
RyanTheTide merged 8 commits into
mainfrom
ewb/t8103-pmu-rtc
Nov 24, 2026
Merged

RyanTheTide merged 8 commits into
mainfrom
ewb/t8103-pmu-rtc

Conversation

@erikwb

@erikwb erikwb commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What: Expose the T8103 (M1) Sera PMU RTC (apple,rtc-base = <0xd000>) and wire nub-spmi's AIC 343 interrupt with apple,response-vector = <192> (plus fix the Sera fault_shadow NVMEM offset to 0xa47b).
Tested: J313 M1 Air (T8103, 13.5 firmware, thanks @mmdisbrow) at 29e245e9: apple,response-vector = 192, apple,rtc-base = 0xd000, rtc0 = &smc_rtc / rtc1 = &pmu_rtc, live spmi_nvmem2 counter tick, 4/4 rtcwake -d rtc1 s2idle wakes via IRQ 126, 0 SPMI/RTC errors, 0 new failed units/kernel errors; J713 M4 Air (T8132 fallback-SoC) at 29e245e9: nub_spmi/nub_spmi_a0 256-vector default, 3/3 rtcwake -d rtc1 -m no -s 10, 0 SPMI timeouts, 0 new failed units/kernel errors; CI (dt-checks, host-tests) green.
Risk: one-way door (new DT properties apple,response-vector and apple,rtc-base; driver and DTS commits must land together) · M1 (T8103) and all Macs using "apple,t8103-spmi" fallback / rtc-apple-pmu.
Not yet: other T8103 boards beyond J313, multi-hour alarm wakes, cold power-off wake.

Details

On Apple M1 (T8103) Macs, the Sera PMU RTC is not exposed to Linux and nub-spmi has no interrupt wired in t8103.dtsi. As a result, there is no PMU alarm RTC for timed wakeups (rtcwake), and enabling nub-spmi's interrupt on T8103 times out every SPMI command because spmi-apple-controller defaulted "apple,t8103-spmi" to the 256-vector gen-1 layout instead of T8103's 192-vector layout.

Commits (all 8 must stay together so kernels carry the driver support before booting a DTB with nub_spmi's interrupt and pmu_rtc wired):

  • dt-bindings: spmi: apple,spmi: add apple,response-vector (5c61e0295fc3): Document optional apple,response-vector (non-zero multiple of 64, up to 256) for gen-1 SPMI controllers; disallow on gen-4 ("apple,t8142-spmi").
  • arm64: dts: apple: t8103: describe nub-spmi response vector (d05dde0ba282): Publish apple,response-vector = <192> on nub_spmi (matching the first interrupt entry in the T8103 ADT nub-spmi node).
  • spmi: apple: read command response vector from DT (ec141ba114c7): Store num_irqs per controller instance, read apple,response-vector on gen-1 controllers with bounds/alignment validation, fall back to match-table default (256 for gen-1, 192 for T6000) when omitted, and warn if present on gen-4.
  • nvmem: apple-spmi: populate Sera's child nodes (faae4f12ac1d): Call devm_of_platform_populate() for "apple,sera-pmic" so the PMIC's child RTC probes.
  • rtc: apple-pmu: read the RTC register block base from DT (a5eb4dea7c5e): Store relative offsets + default base in struct apple_pmu_rtc_hw, read optional apple,rtc-base with 16-bit SPMI span validation (base <= 0xffff and base + span <= 0x10000), and cover Sera's 0xd000 layout + reg-base mutation in tools/asahi/pmu-rtc-tests.py and run-host-tests.py.
  • dt-bindings: rtc: apple,j700-pmu-rtc: add apple,rtc-base and apple,t8103-pmu-rtc (9daec27d5608): Document optional apple,rtc-base (uint32, maximum: 0xffff) and "apple,t8103-pmu-rtc" (with "apple,t8112-pmu-rtc" fallback). Uses apple,rtc-base instead of reg because pmic1 sits under a #size-cells = <0> SPMI controller (#size-cells = <1> logs OF: Bad cell count, while #size-cells = <0> conflicts with nvmem.yaml).
  • arm64: dts: apple: t8103: fix Sera PMU fault-shadow NVMEM offset (c94b3c3bfa76): Correct fault_shadow from 0xa67b to 0xa47b per T8103 ADT spmi-pmu info-fault_shadow = <42107 16>.
  • arm64: dts: apple: t8103: wire the PMU RTC and nub-spmi's interrupt (29e245e97e7c): Wire nub_spmi AIC 343 interrupt + interrupt-controller, add pmu_rtc: rtc (apple,rtc-base = <0xd000>, SPMI IRQ 2, wakeup-source, rtc_offset), and alias rtc0 = &smc_rtc, rtc1 = &pmu_rtc.
Evidence

At exact head 29e245e97e7cc660daf5b00cd1d36bd4bbbf2057:

  • GitHub CI: Device tree checks/dt-checks PASS, Host tests/host-tests PASS (13/13 pmu-rtc including Sera 0xd000 and reg-base mutation).
  • Checkpatch (./scripts/checkpatch.pl --strict --git a84637dca209..29e245e97e7c): 0 errors across all 8 commits.
  • J313 M1 MacBook Air (apple,j313, apple,t8103, 13.5 firmware, tested by @mmdisbrow):
    • rtc0 -> macsmc-rtc, rtc1 -> apple-pmu-rtc (apple,rtc-base = 0xd000, wakeup = enabled, wakealarm present), nub_spmi apple,response-vector = 192 + AIC 343, fault-shadow@a47b present.
    • spmi_nvmem2 reads at 0xa47b and 0xd000 live; 6-byte counter at 0xd002 ticked +79,032 ticks (1.206 s at 65,536 Hz) over 1.2 s.
    • 4/4 s2idle alarm wakes (3× rtcwake -d rtc1 -m freeze -s 15, 1× rtcwake -d rtc1 -m no -s 15 + freeze): suspend_stats/success 0 -> 4, every wake in the programmed second, pm_wakeup_irq = 126, IRQ 126 count 0 -> 4.
    • Regression counts: 0 SPMI timeouts/errors, 0 PMU RTC errors, 0 AVC denials (AppArmor), 0 new failed units, 0 new kernel errors.
  • J713 M4 MacBook Air (apple,j713, apple,t8132, default cmdline, fallback-SoC check):
    • nub_spmi and nub_spmi_a0 both bound apple-spmi via "apple,t8103-spmi" fallback with 256-vector default; PMIC 0-0e, USB-PD 1-0a/1-0c, spmi_nvmem0 probed; 0 SPMI timeouts.
    • rtc-apple-pmu (abbey layout, no apple,rtc-base) probed as rtc1 with default base; 3/3 rtcwake -d rtc1 -m no -s 10 fired via SPMI IRQ (count 1, 2, 3) and rtcwake -d rtc1 -m disable cleared armed alarm.
    • Regression counts: 0 SPMI timeouts, 0 AVC denials, 0 new failed units, 0 new kernel errors.

Thanks to @mmdisbrow for running the J313 13.5 firmware exact-head verification.

@RyanTheTide

Copy link
Copy Markdown
Contributor

host-tests fails in pmu-rtc-tests (and so in all its mutation runs): the harness copies the driver's hardware tables into pmu-rtc.c and builds them with -Wall -Wextra -Werror, and the new apple_pmu_rtc_sera table is never referenced in the harness: pmu-rtc.c:176: error: 'apple_pmu_rtc_sera' defined but not used [-Werror=unused-const-variable=]. Adding a Sera case to tools/asahi/pmu-rtc-tests.py that uses the table (it also gives the new T8103 path test coverage) should clear it. Marking it __maybe_unused would also build, but then the new path stays untested.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for picking up M1. Rtcwake on the J313 is a good result. Four points, the first one blocking:

  1. The compatible's position picks the layout. With this change "apple,t8103-spmi" means 192 vectors when it is listed first and 256 when it is a fallback (of_property_match_string(...) == 0 in apple_spmi_probe()). That is a chip gate in another form, and it goes against what a fallback compatible means. Today T8112, T602x and the rest really do depend on "apple,t8103-spmi" meaning a layout that M1 itself doesn't have. The vector count is a property of the controller instance, and the ADT already gives it (as the comment says, nub-spmi's interrupt list names the notification vector first). Describing it in the DT (the notification vector, or the peripheral IRQ count) and reading it in probe would let every SoC carry its own number, with no compatible-position special case. Old DTBs keep today's behaviour when the property is missing. If you'd rather keep a compatible, a new native T8103 compatible mapped to the 192 layout is still better than overloading the existing string by position.

  2. Rollout order. As you note, a kernel without the driver change times out every SPMI command on the new t8103 DTB. Please keep the driver commit(s) and the DTS commit in one PR that merges as a unit, and say in the DTS commit message that it needs the driver commit, so nobody cherry-picks the DTS alone into a kernel or Stage 2 DTB.

  3. fault_shadow 0xa67b -> 0xa47b is a separate fix inside the DTS commit, with no source given. Where does 0xa47b come from (the ADT?), and does anything read that cell today? If a consumer reads the wrong offset now, that should be its own commit with that explanation.

  4. Sera's RTC block at 0xd000: please say where the base comes from (the ADT's PMU node, or a measurement), as the other PMU layouts' comments do.

Rows still to run, as listed: rtcwake -d rtc1 with the final aliases. Also one boot on a SoC that lists "apple,t8103-spmi" as a fallback (M1 Pro/Max or M2), showing its SPMI controller still probes with 256 vectors and no command timeouts.

Assisted-by: LLM (Claude:Opus 5.5)

@erikwb

erikwb commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Gemini 4 Neon responding on behalf of erikwb

Updated the series (head 7a593930a2e5) to address all four review points and the pmu-rtc-tests CI failure:

  1. SPMI response vector via DT property: Removed the positional of_property_match_string(..., "apple,t8103-spmi") == 0 check. Added optional apple,response-vector (non-zero multiple of 64, up to 256) to Documentation/devicetree/bindings/spmi/apple,spmi.yaml (72888d77cf91), published apple,response-vector = <192> on T8103's nub_spmi (655d07acb17f), and updated spmi-apple-controller to read it per instance while keeping the match-table default (256 for gen-1, 192 for T6000) when omitted (aba6af259d61).
  2. Rollout order: Kept all driver and DTS commits in this PR, with the property-only DTS commit before the driver commit and an explicit dependency note in the interrupt-enabling DTS commit (7a593930a2e5) warning not to cherry-pick it without aba6af259d61.
  3. fault_shadow (0xa67b -> 0xa47b): Split into its own commit (a57196d8d12a). 0xa47b (16 bytes) comes from the T8103 ADT /arm-io/nub-spmi/spmi-pmu property info-fault_shadow = <42107 16> and was confirmed by reading spmi_nvmem0 on J313. No in-tree driver currently references &fault_shadow; it is exposed via NVMEM sysfs.
  4. Sera RTC base (0xd000) provenance: Documented in drivers/rtc/rtc-apple-pmu.c and commit d331cc86bdf6 that 0xd000 (control), 0xd002 (counter), 0xd008 (compare), 0xd00c (event), and 0xd00e (mask) come from the T8103 ADT spmi-pmu info-rtc* properties.
  5. pmu-rtc-tests failure: Added SERA to tools/asahi/pmu-rtc-tests.py and a sera-control mutation to tools/asahi/run-host-tests.py inside d331cc86bdf6. Verified locally with python3 -I tools/asahi/run-host-tests.py --only pmu-rtc (13/13 passed) and ARCH=arm64 LLVM=1 compile of all three drivers and all five t8103-*.dtb targets (0 warnings, 0 errors).

The remaining hardware test items (rtcwake -d rtc1 with the final aliases and a boot on a SoC listing "apple,t8103-spmi" as a fallback) remain in Still to run.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-reviewed at 7a59393.

Earlier points:

  1. Vector count: fixed. apple,response-vector is read per instance in apple_spmi_probe(), bounded to a non-zero multiple of 64 up to SPMI_MAX_PERIPHERAL_IRQS, so the mask/ack loops and the words[] restore buffer stay in bounds. No compatible-position test is left.
  2. Rollout: fine as long as the series merges as one PR. The dependency note on 7a59393 covers a cherry-pick.
  3. fault_shadow: fixed, own commit, value from the ADT info-fault_shadow.
  4. Sera RTC provenance: documented (ADT info-rtc*).

One thing left. The commit says Sera is "laid out as Stowe from its RTC block at 0xd000", so the new apple_pmu_rtc_sera table differs from the existing layout only by a base address that the ADT already describes. That base belongs in the rtc node (reg = <0xd000 ...> relative to the PMU, or a base property), with the driver adding the shared offsets, rather than a second per-chip register table keyed on apple,t8103-pmu-rtc. Then the next PMU with the same block needs a DT node and no driver change.

Small: apple,response-vector is silently ignored on controllers without legacy_irqs. Either say so in the binding or warn when it is present there.

Rows still owed, as listed in the PR: rtcwake -d rtc1 on a T8103 with the final aliases, and one boot on a SoC that lists apple,t8103-spmi as a fallback (an M2/T8112 boot shows the 256-vector default path is unchanged).

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adversarial review against pre-pr-checklist.md at 7a593930a2e5.

Summary: CI is green (dt-checks, host-tests), all 8 commits carry human identity and Signed-off-by: only, and the SPMI apple,response-vector DT property + bounds/alignment validation ([64..256], multiple of 64) cleanly fixes the earlier compatible-position gating issue without breaking non-T8103 fallback users. The fault_shadow split and ADT provenance notes are also clean.

Blocker (§1 — No per-chip register table where a DT property can carry the value)

  • drivers/rtc/rtc-apple-pmu.c (apple_pmu_rtc_sera): apple_pmu_rtc_sera is identical to apple_pmu_rtc_stowe except for shifting the RTC block base from 0xf800 to 0xd000 (+0x00, +0x02, +0x08, +0x0c, +0x0e), which the ADT already provides via info-rtc*. Under §1 ("Never ... a per-chip table where a property can carry the value"), pass the RTC block base from DT (e.g., reg relative to the PMIC or a base property, keeping the match-table base as the fallback when omitted) rather than duplicating a per-chip register table keyed on apple,t8103-pmu-rtc.

Non-blocking notes

  • drivers/spmi/spmi-apple-controller.c & apple,spmi.yaml: apple,response-vector is silently ignored on non-legacy_irqs (gen-4) controllers. Either constrain it in apple,spmi.yaml or warn in probe when present on gen-4.
  • drivers/nvmem/apple-spmi-nvmem.c: Extending the compatible allowlist with "apple,sera-pmic" follows existing code, though eventually populating child nodes generically (or via DT structure) would avoid growing a per-PMIC list.

Hardware/runtime evidence still owed (§5)

  • T8103 (J313, and another T8103 board / 13.5 firmware if available) on the final head verifying rtcwake -d rtc1 with the rtc0 = &smc_rtc / rtc1 = &pmu_rtc aliases, plus regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors).
  • One boot on a non-T8103 SoC that lists "apple,t8103-spmi" as a fallback (e.g., M2/T8112) confirming the 256-vector default path probes with 0 SPMI command timeouts.

Assisted-by: LLM (Gemini 4 Neon)

Document the optional apple,response-vector property for gen-1 Apple SPMI
controllers so a devicetree node can state its RX FIFO command-response
vector (and peripheral interrupt count) directly instead of deriving it
from compatible-string position. Disallow it on generation 4
("apple,t8142-spmi") controllers, which do not use the gen-1 interrupt
layout.

Signed-off-by: Erik Bourget <erik@ebourget.net>
T8103's nub-spmi reports command replies on vector 192 (the first
interrupt listed in the ADT's nub-spmi node). Publish
apple,response-vector = <192> on nub_spmi before wiring its interrupt or
teaching spmi-apple-controller to read the property; kernels without
support continue polling as before.

Signed-off-by: Erik Bourget <erik@ebourget.net>
T8103's SPMI controllers report command replies on vector 192 (matching
the first interrupt entry in the ADT's nub-spmi node), while later SoCs
that list "apple,t8103-spmi" as a fallback compatible use 256 vectors.

Store the active vector count per controller instance, defaulting to the
match-table value (256 for gen-1, 192 for T6000) and allowing gen-1
nodes to override it via the apple,response-vector DT property
(validated as a non-zero multiple of 64 up to SPMI_MAX_PERIPHERAL_IRQS).
Warn if apple,response-vector is present on a generation 4 controller
where the legacy interrupt layout is unused. Existing DTBs without the
property keep their current behavior.

Signed-off-by: Erik Bourget <erik@ebourget.net>
M1's PMU (Sera) carries an RTC child node like the other Apple PMUs;
populate its child platform devices in probe.

Signed-off-by: Erik Bourget <erik@ebourget.net>
Store per-layout register offsets relative to the RTC block base in
struct apple_pmu_rtc_hw, keeping each existing layout's historical base
as the fallback when the devicetree node omits apple,rtc-base. When
apple,rtc-base is present on the RTC node, validate that the block fits
within the 16-bit SPMI register space and add rtc->base to the shared
offsets.

This lets PMUs that share an existing register layout at a different
block base — such as M1's Sera at 0xd000 (from the T8103 ADT spmi-pmu
info-rtc* properties, matching Stowe's offsets and signed 1/32768 s
offset format) — reuse the existing layout table from DT without adding
a duplicate per-chip register table.

Update tools/asahi/pmu-rtc-tests.py and run-host-tests.py to exercise
Stowe's layout rebased to Sera's 0xd000 block and add a reg-base
mutation check ensuring rtc->base is honored.

Signed-off-by: Erik Bourget <erik@ebourget.net>
…103-pmu-rtc

Document the optional apple,rtc-base property carrying the RTC register
block's base offset in the parent PMIC's 16-bit SPMI register space, and
add apple,t8103-pmu-rtc (with apple,t8112-pmu-rtc fallback and required
apple,rtc-base). Using a dedicated property avoids adding #address-cells /
#size-cells and reg on a child of an apple,spmi-nvmem node under a
#size-cells = <0> SPMI bus, which would trigger OF address-translation
cell-count errors during platform-device population.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The T8103 ADT spmi-pmu node places the 16-byte fault shadow cell at
0xa47b (info-fault_shadow = <42107 16>), confirmed by reading
spmi_nvmem0 on a J313 (M1 MacBook Air), rather than 0xa67b.

No in-tree driver currently references &fault_shadow; the cell is
exposed via NVMEM sysfs.

Signed-off-by: Erik Bourget <erik@ebourget.net>
nub-spmi raises its peripheral and command-reply interrupts on AIC 343
with its response notification on vector 192. Describe nub_spmi as an
interrupt controller, add the Sera PMU RTC child node with
apple,rtc-base = <0xd000> (matching the T8103 ADT spmi-pmu info-rtc*
properties; compatible with apple,t8112-pmu-rtc; SPMI interrupt 2,
wakeup-source, shared rtc_offset cell), and alias rtc0 = &smc_rtc and
rtc1 = &pmu_rtc so rtc0 remains the writable SMC RTC.

Depends on "spmi: apple: read command response vector from DT" and
"rtc: apple-pmu: read the RTC register block base from DT" in this
series; do not cherry-pick this DTS change onto a kernel or Stage 2 DTB
without those driver commits, or nub-spmi commands will time out waiting
on vector 256 and the RTC will address 0xf800 instead of 0xd000.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Gemini 4 Neon responding on behalf of erikwb

Refactored the series (head 29e245e97e7c) to address the Sera register-table blocker and the gen-4 apple,response-vector note:

  1. DT-supplied RTC block base (apple,rtc-base) instead of a per-chip Sera table (§1):
    • a5eb4dea7c5e (rtc: apple-pmu: read the RTC register block base from DT): Replaced absolute addresses in struct apple_pmu_rtc_hw with shared relative offsets plus each layout's historical base fallback, removed apple_pmu_rtc_sera and the apple,t8103-pmu-rtc match entry, and taught apple_pmu_rtc_probe() to read optional apple,rtc-base from DT (validating base <= 0xffff and base + span <= 0x10000, falling back to hw->base when omitted so existing DTBs remain unchanged). Updated tools/asahi/pmu-rtc-tests.py and run-host-tests.py to test Stowe's layout rebased to Sera's 0xd000 block with a new reg-base mutation check.
    • 9daec27d5608 (dt-bindings: rtc: apple,j700-pmu-rtc: add apple,rtc-base and apple,t8103-pmu-rtc): Documented optional apple,rtc-base (uint32, maximum: 0xffff) and listed apple,t8103-pmu-rtc with apple,t8112-pmu-rtc fallback and required apple,rtc-base. We chose apple,rtc-base over reg because pmic1 is under a #size-cells = <0> SPMI controller: using reg with #size-cells = <1> triggers OF: Bad cell count (KERN_ERR) in __of_translate_address() during devm_of_platform_populate(), while #size-cells = <0> conflicts with nvmem.yaml's #size-cells: const: 1.
    • 29e245e97e7c (arm64: dts: apple: t8103: wire the PMU RTC and nub-spmi's interrupt): Kept pmu_rtc: rtc matching every other Apple SoC DTSI, with compatible = "apple,t8103-pmu-rtc", "apple,t8112-pmu-rtc"; and apple,rtc-base = <0xd000>; (plus updated rollout dependency note).
  2. apple,response-vector on gen-4 controllers:
    • 5c61e0295fc3 (apple,spmi.yaml): Disallowed apple,response-vector on apple,t8142-spmi via if/then and noted in the description that it is gen-1 only.
    • ec141ba114c7 (spmi-apple-controller.c): Added dev_warn() in apple_spmi_probe() when apple,response-vector is present on a !legacy_irqs (gen-4) controller.

Verified locally on 29e245e97e7c: run-host-tests.py --only pmu-rtc (13/13 PASS), hardware-defaults-tests.py (6/6 PASS), ARCH=arm64 LLVM=1 W=1 build of all three drivers and all five t8103-*.dtb (0 warnings, 0 errors), and scripts/dtc/apple-dt-check.sh a84637dca209 HEAD (all 138 Apple DTBs built with 0 new warnings; dt_binding_check passed on apple,spmi.yaml and apple,j700-pmu-rtc.yaml). Remaining hardware rows are tracked in Still to run.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at 29e245e: the Sera table is gone. The driver now holds one set of relative offsets and takes the block base from apple,rtc-base (bounded so the whole register span stays inside the PMU's 64 KiB), falling back to each layout's historical base so existing trees are unchanged, and the T8103 node supplies 0xd000 from the ADT. That's the shape asked for; the next PMU with the same block only needs a DT node. The response-vector note is answered too. Code is done from our side; the two rows listed earlier (T8103 rtcwake -d rtc1, one fallback-SoC boot) remain.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review against pre-pr-checklist.md (§1–§6) at 29e245e97e7c.

Prior blocker & notes verified fixed

  • §1 (Sera per-chip register table removed): apple_pmu_rtc_sera and the apple,t8103-pmu-rtc driver match entry are gone. struct apple_pmu_rtc_hw now holds relative offsets plus each layout's historical .base fallback, every register access in drivers/rtc/rtc-apple-pmu.c goes through apple_pmu_rtc_reg(rtc, ...), and apple_pmu_rtc_parse_base() validates base <= 0xffff and (u64)base + span <= 0x10000 (keeping all accesses within the 16-bit SPMI address space without u16 wrap). apple,j700-pmu-rtc.yaml documents apple,rtc-base and requires it on apple,t8103-pmu-rtc (with apple,t8112-pmu-rtc fallback), and tools/asahi/pmu-rtc-tests.py + run-host-tests.py cover SERA rebased to 0xd000 with the reg-base mutation.
  • Gen-4 apple,response-vector: Disallowed on apple,t8142-spmi in apple,spmi.yaml and emits dev_warn() in apple_spmi_probe() on !legacy_irqs controllers. All runtime paths in spmi-apple-controller.c consistently use per-instance spmi->num_irqs.
  • §2 / §3 / §4 / §6: Clean. All 8 commits carry human identity and human Signed-off-by: only (zero AI trailers in commits), Assisted-by: is at the end of the PR body, and no regressions were introduced.

Holding for CI & §5 hardware evidence

  • CI (dt-checks: IN_PROGRESS, host-tests: SUCCESS): Still completing on 29e245e97e7c at review time.
  • §5 hardware runs owed on live head 29e245e97e7c:
    1. T8103 (J313, plus another T8103 board / 13.5 firmware if available): rtcwake -d rtc1 with apple,rtc-base = <0xd000> and rtc0 = &smc_rtc / rtc1 = &pmu_rtc aliases, plus regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors).
    2. One boot on a non-T8103 SoC using "apple,t8103-spmi" as a fallback (e.g., M2/T8112) confirming 256-vector default probing with 0 SPMI command timeouts and unchanged PMU RTC default base.

Code is ready from my side once CI finishes green and the two §5 rows are posted.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Still needed: nothing on integration/aurora at daa9e2d exposes the T8103 PMU RTC or reads the response vector from the device tree, and 29e245e merges onto that tip without conflicts with dt-checks and host-tests green. The code review is settled at this head; the change request shown is from the previous head. @erikwb the two rows are what is left: rtcwake -d rtc1 on a T8103 with the final device tree, and one boot on a SoC that lists apple,t8103-spmi as a fallback (a T8112, for example) showing its SPMI devices and PMU RTC unchanged.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formal §1–§6 pre-PR checklist re-review at 29e245e97e7cc660daf5b00cd1d36bd4bbbf2057 (dt-checks: green; host-tests: green; mergeStateStatus: CLEAN; not superseded on integration/aurora).

Code, Safety & Attribution Assessment (0 code blockers)

  • §1 No model gating: Pass — apple,response-vector (validated as a non-zero multiple of 64 up to SPMI_MAX_PERIPHERAL_IRQS, disallowed on apple,t8142-spmi in apple,spmi.yaml, and emitting dev_warn() on !legacy_irqs controllers) cleanly replaces positional compatible matching. apple,rtc-base replaces the per-chip Sera table (struct apple_pmu_rtc_hw stores relative offsets plus historical .base fallback, apple_pmu_rtc_parse_base() bounds base <= 0xffff and (u64)base + span <= 0x10000, and every register access in rtc-apple-pmu.c goes through apple_pmu_rtc_reg()). All runtime sites in spmi-apple-controller.c consistently use per-instance spmi->num_irqs.
  • §2 Production-ready / §3 Safety / §6 Naming: Pass — default command line, clean DT binding validation (dt-checks green), fault_shadow (0xa47b) split into its own commit with ADT provenance, rollout dependency documented on 29e245e97e7c, and pmu-rtc-tests.py covers SERA + reg-base mutation (host-tests green).
  • §4 Clean-room & attribution: Pass — all 8 commits carry human author/committer (Erik Bourget <erik@ebourget.net>) and human Signed-off-by: only, zero AI commit trailers; Assisted-by: is at the end of the PR body.

§5 Blocker Holding APPROVE / MERGETRAIN-LINUX4

  • No exact-head hardware runs at 29e245e97e7c: Prior J313 boots predated apple,response-vector, apple,rtc-base, and the rtc0/rtc1 aliases.
  • Required before approval:
    1. Exact-head (29e245e97e7c, default cmdline) T8103 (J313, plus another T8103 board / 13.5 firmware if available) hardware run verifying rtcwake -d rtc1 with apple,rtc-base = <0xd000> and rtc0 = &smc_rtc / rtc1 = &pmu_rtc aliases, plus regression counts (0 SPMI timeouts/errors, 0 SELinux denials, 0 failed units, 0 new kernel errors).
    2. One boot on a non-T8103 SoC using "apple,t8103-spmi" as a fallback (e.g., M2/T8112) confirming 256-vector default probing with 0 SPMI command timeouts and unchanged PMU RTC default base.

Assisted-by: LLM (Gemini 4 Neon)

@erikwb

erikwb commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Sonnet 5.5 responding on behalf of erikwb

The fallback-SoC boot is done: 29e245e97e7c on a J713 (T8132), default kernel command line, one boot.

  • The two enabled controllers (nub_spmi, nub_spmi_a0) bound through "apple,t8103-spmi" with no apple,response-vector, so the 256-vector default applied. 0 SPMI timeouts, and the PMU RTC interrupt was delivered.
  • rtc-apple-pmu probed pmu_rtc (abbey layout) as rtc1 with no apple,rtc-base and kept its default base. rtcwake -d rtc1 -m no -s 10 ×3: each alarm armed, fired through the SPMI interrupt, and cleared.
  • Regression: 0 SELinux denials (SELinux is not installed on this board's image), 0 new failed units (one, aurora-power-defaults.service, also fails on the default kernel), 0 new kernel errors.

I added the row to Testing and removed it from Still to run. What remains there is the T8103 rtcwake -d rtc1 row on the J313.

@mmdisbrow

mmdisbrow commented Nov 24, 2026 •

Copy link
Copy Markdown

This is the T8103 rtcwake -d rtc1 row from Still to run, on 13.5 firmware (the earlier J313 runs were on 27.2.1). Tested #2714 (29e245e97e7c) on an M1 MacBook Air (apple,j313, apple,t8103). rtc1 (apple-pmu-rtc) probed, its counter ticked at the expected rate, and 4 of 4 s2idle alarm wakes resumed in the programmed second with 0 SPMI or RTC errors.

Machine and build

  • Hardware. MacBook Air M1 (apple,j313, apple,t8103).
  • Firmware. asahi,os-fw-version: 13.5, asahi,system-fw-version: 26.6.2.
  • Kernel. Local 7.3.0-tier2-j313-ARCH+: integration/aurora 377060f3688a plus this PR's exact diff at 29e245e97e7c, arm64: dts: apple: t8103: enable SIO on every board (needs an M1 tester) #1114 (21e911cb4236, SIO DT nodes only), and phy: apple: atc: apply the AXI2AF tunables at probe #2836 (fe1c51dd3cb0, drivers/phy/apple/atc.c only). Neither touches SPMI, nvmem, or RTC code or nodes.
  • DTB. t8103-j313.dtb from this tree with one local change carried over from the installed m1n1 FDT: DCP/DCPEXT iommus base_hi = 0x0f instead of 0x00, the window this machine's 13.5 DCP firmware uses. No SPMI, PMIC, or RTC node changed.
  • Command line. rw loglevel=3 quiet systemd.unit=multi-user.target (root args omitted). systemd.unit= only changes the systemd target; the installed Mesa does not support the 7.3 aurora GPU driver yet.
  • Host/build checks on this tree: pmu-rtc host tests 13/13, W=1 0 warnings on the modified objects.

Live J313 probe and nvmem receipts

  • DT aliases and properties in /proc/device-tree:
    • rtc0 -> /soc/smc@23e400000/rtc (apple,smc-rtc), sysfs name macsmc-rtc macsmc-rtc.
    • rtc1 -> /soc/spmi@23d0d9300/pmic@f/rtc (apple,t8103-pmu-rtc, apple,t8112-pmu-rtc), apple,rtc-base = 0xd000, sysfs name apple-pmu-rtc 23d0d9300.spmi:pmic@f:rtc, wakeup = enabled, wakealarm present.
    • /soc/spmi@23d0d9300: apple,response-vector = 192, interrupts = <0 343 4> (AIC 343).
    • /soc/spmi@23d0d9300/pmic@f/nvmem-layout/fault-shadow@a47b present.
  • spmi_nvmem2 reads:
    • @0xa47b (16 B): 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    • @0xd000 (16 B): 01 02 24 5d 0c 44 33 04 d8 69 2c 99 00 00 01 00
    • 6-byte RTC counter at 0xd002 advanced 79,032 ticks (1.206 s at 65,536 Hz) across a 1.2 s sleep: 86 5e 0c 44 33 04 -> 3e 93 0d 44 33 04.

Live s2idle wake-alarm cycles

  • 3 × rtcwake -d rtc1 -m freeze -s 15, then 1 × rtcwake -d rtc1 -m no -s 15 followed by echo freeze > /sys/power/state (from the omacom/omarchy#12427 hook test):
    • suspend_stats/success: 0 -> 1 -> 2 -> 3 -> 4.
    • Every cycle resumed in the same second as the programmed wakealarm epoch (1 s resolution).
    • pm_wakeup_irq reported 126 on all 4 wakes, and PMU RTC child IRQ 126 incremented 0 -> 1 -> 2 -> 3 -> 4. (rtc1/device/power/wakeup_count stayed 0; the wake evidence came from pm_wakeup_irq and IRQ 126.)
  • Expected with rtc0 = &smc_rtc: tools that default to /dev/rtc0 find no alarm. A bare rtcwake -m no -s 15 fails with set rtc wake alarm failed: Invalid argument and arms nothing, so callers need -d rtc1.

Regression counts

  • 0 SPMI timeout/error lines and 0 PMU RTC error lines across boot and all 4 cycles.
  • SELinux is not present on this install (systemd -SELINUX, AppArmor), so 0 AVC denials.
  • 1 failed unit, omarchy-mac-touchid-activate.service ("Touch ID is not ready to enrol and match"), which fails the same way on this machine's 7.2.11 kernel (0 new).
  • 0 error-level kernel messages at boot. Each s2idle resume logs apple-pmgr-pwrstate ...: PS fpwm1: Failed to reach power state 0xf (requested 0xf, now: 0xa4f), which this machine also logs on 7.2.11 (0 new).

Not tested

  • Other T8103 boards, multi-hour alarm wakes, cold power-off wake, and GUI/desktop suspend under 7.3 Mesa.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: FINISH at 29e245e9

Blockers:

  • PR description: remove the trailing Assisted-by: footer to comply with org policy (zero AI attribution in PR text), and move @mmdisbrow's exact-head J313 rtcwake -d rtc1 row out of Still to run into Testing.

Checked: Code, DT bindings, dt-checks/host-tests CI, commit trailers (8/8 clean), and both requested exact-head hardware rows (J713 T8132 fallback-SoC boot and @mmdisbrow's J313 T8103 13.5 firmware rtcwake -d rtc1 4/4 s2idle wake row) all pass; ready to approve as soon as the PR description is updated.

Evidence
  • Exact head: 29e245e97e7cc660daf5b00cd1d36bd4bbbf2057 (8 commits, human author/committer + Signed-off-by: only, zero AI trailers in commits).
  • CI on exact head: dt-checks PASS, host-tests PASS.
  • Exact-head hardware evidence:
    • J713 (T8132 fallback-SoC, default cmdline): nub_spmi/nub_spmi_a0 bound with 256-vector default, rtcwake -d rtc1 -m no -s 10 x3 PASS, 0 SPMI timeouts, 0 new failed units/errors.
    • J313 (T8103 M1 Air, 13.5 firmware, @mmdisbrow): apple,response-vector = 192, apple,rtc-base = 0xd000, rtc0 = &smc_rtc / rtc1 = &pmu_rtc, live spmi_nvmem2 counter advance, 4/4 s2idle rtcwake -d rtc1 wakes via IRQ 126, 0 SPMI/RTC errors, 0 new failed units/errors.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at 29e245e9: not ready yet

Check Detail
CI at head ok 2 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head ok in the PR body at 29e245e9
Conflicts ok none
PR text ok Risk: one-way · (new DT properties apple,response-vector and apple,rtc-base; driver and DTS commits must land together) · M1 (T8103) and all Macs using "apple,t8103-spmi" fallback / rtc-apple-pmu.

Areas: area:gpu, area:platform

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

@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) and removed needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: MERGE at 29e245e97e7c

Blockers: none

Checked:

  • §4 / §5 PR body cleanup verified: trailing Assisted-by: footer removed, exact-head 29e245e9 J313 and J713 rows documented, and pr-text is green; all 8 commits carry human author/committer and Signed-off-by: with zero attribution.
  • Code, DT bindings (apple,response-vector), dt-checks, host-tests, and both exact-head hardware rows (J713 T8132 fallback-SoC boot and J313 T8103 rtcwake -d rtc1) are all clean and verified.
Evidence
  • Exact head: 29e245e97e7cc660daf5b00cd1d36bd4bbbf2057 (OPEN, isDraft: false, MERGEABLE, 3/3 CI checks passing).

@RyanTheTide
RyanTheTide merged commit 01ae188 into main Nov 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:one-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants