Skip to content

spmi: apple: support generation-4 interrupts - #2494

Closed
satchlj wants to merge 1 commit into
integration/aurorafrom
satchlj/spmi-gen4-irq-rtc-alarm-20261119
Closed

satchlj wants to merge 1 commit into
integration/aurorafrom
satchlj/spmi-gen4-irq-rtc-alarm-20261119

Conversation

@satchlj

@satchlj satchlj commented Nov 19, 2026

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

spmi-apple-controller refuses an interrupt on generation-4 controllers (T8142, T6050) with "Generation 4 interrupt layout is not supported". So a PMU peripheral interrupt, such as the RTC alarm, cannot reach Linux on those SoCs. On the Mac Studio (J775c, T6050) that leaves suspend-to-idle with no RTC wake source. The PMU's alarm is its peripheral interrupt 2 on /arm-io/nub-spmi0.

Change (driver only)

  • Generation 4 layout: each controller generation gets its own interrupt mask and acknowledge bases. Generation 4 uses 32-bit words, masks from 0x400 and acknowledges from 0x600 (the base the fault-interrupt acknowledge already uses), with 256 peripheral interrupts, the reply notification at 256 and the fault interrupt at 263.
  • 32-bit status reads: generation-4 status words are read 32 bits at a time.
  • No refusal: the probe no longer refuses the interrupt.

The existing fault draining, recovery and suspend/resume masking are unchanged and now use the per-generation bases.

No behaviour change on its own: no generation-4 controller in the tree names an interrupt today. The J775c device-tree side (nub-spmi0 as an interrupt controller on AIC 726, and the SMC RTC's alarm interrupt with wakeup-source) follows as a separate PR on top of #2102.

Testing

  • drivers/spmi/spmi-apple-controller.o builds without warnings on integration/aurora 26294e82 (gcc 16.1.1, arm64).
  • This is a port onto the current driver of the interrupt support lobata's current default kernel carries. That kernel has run with the PMU alarm on apple_spmi interrupt 2 since 2026-11-08, and 3/3 s2idle cycles woke from the RTC alarm on 2026-11-19.
  • This port itself is untested on hardware.

🤖 Generated with Claude Code

Generation 4 controllers (T8142, T6050) were refused an interrupt at
probe ("Generation 4 interrupt layout is not supported"), so their PMU's
peripheral interrupts, such as the RTC alarm, could not reach Linux.

Their interrupt banks are 32-bit words: mask words from 0x400 and
acknowledge words from 0x600 (the same base the fault-interrupt
acknowledge already uses), with 256 peripheral interrupts, the reply
notification at 256 and the fault interrupt at 263. Give each generation
its own mask and acknowledge bases, read generation-4 status words 32 bits
at a time, and stop refusing the interrupt.

Nothing changes for a generation-4 controller whose device tree names no
interrupt, which is every one in the tree today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Satya Benson <satya@benson.earth>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for porting this and for the J775c alarm-wake evidence.

This is the same mechanism as #1743: per-generation mask/ack bases at 0x400/0x600, num_irqs for generation 4, and the -EOPNOTSUPP refusal removed. We keep one implementation per mechanism, and #1743 is where generation-4 follower interrupts land (#2466 was closed in its favour for the same reason). #1743 also covers two things this port does not:

  • the fault source 263 shares ack word 0x620 with the notification; the handler here writes val & ~BIT(notify % 32) back to that word (spmi-apple-controller.c:549) before the fault FIFO is drained;
  • the init/teardown loops (:607, :627-628) run (num_irqs + 32) / 8 bytes, i.e. 9 words including 0x420, which does not toggle on generation 4 ([Joshua's agent] spmi: apple: gen4 interrupts and the gen4 mask bank (draft) #1743 writes 8).

Could you close this one and post the J775c apple_spmi 2 Edge macsmc-rtc row on #1743's head instead? #2495 can then stack on #1743. A row from a second generation-4 machine there would help it land.

@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: thanks, agreed. Closing this one in favour of #1743. It is the same mechanism, and #1743 also handles fault source 263 and writes the eight gen-4 words rather than nine.

I posted the J775c row on #1743, marked as coming from this PR's implementation, not #1743's head. lobata's next candidate carries #1743 instead of this PR, and #2495 now states #1743 as its gen-4 dependency.

🤖 Generated with Claude Code

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.

2 participants