Repository navigation
soc: apple: mailbox: receive ASCWrap v8 mailboxes by interrupt - #1851
DjDeveloperr wants to merge 4 commits into
Conversation
ASC mailboxes are interrupt driven. The T8152 GPU ASCWrap v8 mailboxes now receive and send the same way as the other ASC mailboxes do: - the recv-not-empty line, the threaded and oneshot GPU receive interrupt, is enabled by apple_mbox_start() and disabled by apple_mbox_stop(); - its handler drains the post-office RX FIFO until it is empty, one receive budget per pass; - a non-atomic sender that finds the TX FIFO full waits for the send-empty interrupt and its completion. Both GPU mailbox nodes describe that line. Remove the receive poller, the poll-only default, the storm guard and the sleeping poll of a full TX FIFO, with the provider state and the start, stop and removal paths that only served them. Remove the ascwrap_v8_rx_irq module parameter: interrupts are the only mode, and nothing in the tree sets it. A leftover apple_mailbox.ascwrap_v8_rx_irq= is ignored, silently when the driver is built in and with an "unknown parameter" warning when it is a module, so a command line that still passes it keeps booting. The J873 GPU dtsi and the G18 boot notes no longer mention it. Keep what is not about polling: the wrapper, iop-vbar, post-office and PSD windows, the ascwrap_v8_cpu_control parameter and the CPU start and stop it gates, and the PSD check before every post-office receive. When that check finds the block unpowered, the receive handler reads nothing. The receive interrupt is enabled only when a consumer starts the mailbox; the G18 backend does that only after the PSD services are powered, and only with ascwrap_v8_cpu_control=1. This has not been run on a T8152 board yet: the receive and send-empty interrupt assignment of both GPU mailboxes needs a hardware check before this is relied on. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Blockers: 1.
Nit: :1102 changes Checked: the merge with current integration/aurora is clean and leaves no users of the removed poller symbols; dropping the ascwrap_v8_rx_irq parameter is right; #1844 is merged, so only this commit is under review. CI is green. The PR body ends with "Generated with Claude Code"; it should end with an HW row: T8152 (J873) on this head, merged on current integration/aurora, default command line apart from the existing ascwrap_v8_cpu_control=1: GPU mailbox recv-not-empty counts in /proc/interrupts rise with GPU traffic and stay flat when idle; a GPU smoke test passes; a stop/start of the mailboxes (GPU idle/resume) is clean; no "nobody cared", unbalanced enable/disable or GPU timeout lines; 0 AVC, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
|
#1844 is merged, so the PR is now only its last commit. 110861f still has the v8 receive poller, the storm guard and the ascwrap_v8_rx_irq parameter. The commit applies cleanly on 110861f. @DjDeveloperr, two things are still open: the blocker from the review (bound a stuck receive line on ASCWrap v8, for example by returning IRQ_NONE when nothing was consumed, and keep WRITE_ONCE on mbox->active), and the T8152 hardware row. #2489 and #2196 also change mailbox.c, so whichever lands later may need a small rebase. Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches; CHECK_DTBS over every Apple DTB: no new warnings against the tip. |
|
J873g (Mac mini M6, T8152, G18G B1, firmware
Checks & notes:
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: REQUEST CHANGES at 53870b65
Blockers:
- Unbounded level-IRQ storm hazard on ASCWrap v8 (
drivers/soc/apple/mailbox.c). With the v8 receive poller and storm guard removed,apple_mbox_recv_irq()still returnsIRQ_HANDLEDeven whenapple_mbox_poll_locked()returns early on an unpowered PSD or drains zero messages. Because ASCWrap v8 hashas_irq_controls = false(no mailbox-level ack/mask), the oneshot thread immediately unmasks the asserted level line and spins indefinitely while preventing the IRQ core's spurious-IRQ detector (note_interrupt()) from disabling it. ReturnIRQ_NONEwhen nothing is consumed on ASCWrap v8 (or disable the line on the unpowered-PSD path and re-enable on start/restore). - Data race on
mbox->activeinapple_mbox_stop_locked()andapple_mbox_quiesce(). Both paths replaceWRITE_ONCE(mbox->active, false)with a plainmbox->active = falsestore, even thoughapple_mbox_send_nowait()andapple_mbox_recv_nowait()readmbox->activelocklessly viaREAD_ONCE(). KeepWRITE_ONCE()on all writes tombox->active.
Checked:
- Full 3-file diff (
t8152-j873-gpu.dtsi,drivers/gpu/drm/asahi/g18/boot/mod.rs,drivers/soc/apple/mailbox.c,+23/-262),MERGEABLEagainstmain, 11 CI checks passed. - J873g (
T8152G18G B1) A/B hardware smoke row from2026-11-24passed (84,244iterations,421/421checks, IRQ counts rising cleanly under load).
Evidence
- Both blockers were previously flagged on
2026-11-21and2026-11-23and remain unaddressed at head53870b65. - Note: after fixing the two code blockers, please re-run a quick J873g verification at the new head SHA.
…ds nothing ASCWrap v8 has no mailbox-level acknowledge. With the receive poller and its storm guard gone, a recv-not-empty line that fires while the PSD is not powered, or with an empty FIFO, fires again as soon as the handler returns IRQ_HANDLED, and nothing ever stops it. Return IRQ_NONE for a v8 receive interrupt that read nothing, so the IRQ core's spurious-interrupt check disables a line that keeps firing that way. Keep WRITE_ONCE() on every write of mbox->active: the nowait send and receive paths read it without the lock. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Both review points are fixed at |
main flipped the ASCWrap v8 CPU control default to allow; this branch drops the v8 receive poller and its parameter. The provider message keeps main's "allowed (default)" wording without the receive part. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Merged main 06fceca into the branch at Check: the merged Still needed before merge: an independent review of |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at d1f89b3a, after the hardware row below.
Blockers: none. Both earlier points are fixed.
Checked: a v8 receive interrupt that reads nothing (PSD not powered, empty FIFO, no receiver) now returns IRQ_NONE from the hard handler (drivers/soc/apple/mailbox.c:927), so the IRQ core's spurious-interrupt check disables a line that keeps firing. Every write of mbox->active is WRITE_ONCE(). With v8 on the common path, start, stop, quiesce and hold/release keep the receive IRQ's enable and disable balanced (it is requested IRQF_NO_AUTOEN). Mailboxes other than v8 behave as before. No Apple material, no gates, and a parameter goes away rather than a new one. The merge resolves its one conflict, the v8 provider dev_info(), by keeping main's "allowed (default)" wording without the receive part. That is right.
Still owed before merge: the J873g row at this head: boot, receive counts rise under GPU load and stay flat at idle, a GPU smoke test, and no "nobody cared", unbalanced-IRQ or GPU-timeout lines. The 11-24 row predates the IRQ_NONE change. CI is still queued.
I updated the body for main's new ascwrap_v8_cpu_control default. I also took the head SHA off the "still needed" line of my earlier comment, because the readiness check had read it as a row. No J873g row has run at this head yet.
Evidence
d1f89b3amatches a cleangit merge-tree --write-treeof its parents everywhere exceptmailbox.c, the one conflicted file. The earlier merge19f653b0matches a clean merge exactly.- Read the full diff against main, plus
apple_mbox_recv_irq(),apple_mbox_poll_locked(),apple_mbox_start(),apple_mbox_stop_locked(),apple_mbox_quiesce()and the probe's IRQ requests at this head. The v8 handler is not threaded (rx_threadedis G17 only), sonote_interrupt()sees its return value directly. - Only
apple,t8152-gfx-ascwrap-v8setsis_ascwrap_v8, so the runtime change reaches only the T8152 GPU mailboxes. - Nit for a follow-up:
t8152-j873-gpu.dtsi:26still says CPU control is refused unlessascwrap_v8_cpu_control=1, but main has flipped that default.
There was a problem hiding this comment.
Verdict: MERGE at d1f89b3
Checked: The ASCWrap v8 handler now reports an unhandled interrupt when it reads no messages, including when the power check prevents a receive. The active-state writes use WRITE_ONCE() and the lockless users read with READ_ONCE(). Start, stop and quiesce use the shared receive-IRQ lifecycle. The DT and G18 boot changes are comments only. The earlier two review findings are resolved.
Checked: I ran the existing Centauri host test on the exact PR head and its target base 06fceca4. The fixture and all three input files are byte-identical. Both runs report the same missing dev_warn_ratelimited and cen_rx_consume declarations. Current main f52ba21d includes the Centauri fixture fix and passes all three production checks. Hosted log Landed fixture fix
Follow-ups: The DT comment above the GPU mailbox nodes still describes v8 CPU control as opt-in. The driver defaults to allowing it. The earlier J873g row covers the earlier head, with current-head verification tracked in readiness.
RyanTheTide
left a comment
There was a problem hiding this comment.
The ASCWrap v8 receive handler reports an empty or inaccessible FIFO as unhandled, allowing the IRQ core to stop a stuck line. The merge preserves the current CPU-control default and leaves the other mailbox paths alone. The J873g interrupt-mode row at this head is still pending.
What: The T8152 ASCWrap v8 GPU mailboxes receive by their recv-not-empty interrupt, like the other ASC mailboxes, instead of the one-jiffy receive poller. This removes the v8 receive poller, the poll-only default, the storm guard, the sleeping poll of a full TX FIFO and the
apple_mailbox.ascwrap_v8_rx_irqparameter (nothing in the tree sets it). A v8 receive interrupt that reads nothing (PSD not powered, or an empty FIFO) returnsIRQ_NONE, so the IRQ core disables a line that keeps firing that way: v8 has no mailbox-level acknowledge. Every write ofmbox->activestaysWRITE_ONCE(), since the nowait paths read it without the lock. The receive interrupt is enabled only when a consumer starts the mailbox; the G18 backend does that only after the PSD services read powered. Main now allows the v8 CPU control by default (ascwrap_v8_cpu_control), so on the default command line the receive interrupt is used whenever the GPU mailboxes run. Comment-only updates int8152-j873-gpu.dtsiandg18/boot/mod.rs.Tested: sithglan's J873g (Mac mini M6, T8152) A/B row on 11-24 with
53870b65cherry-picked onto main065904c1: PASS. The 75 s EGL/GLES + compute smoke loop andvulkaninforan clean, the GFX and GFX1 recv interrupt counts rose (the polled baseline shows 0), with no storm, unbalanced-IRQ or GPU-timeout messages. That row predates274e2d3d, which merges current main and adds theIRQ_NONEreturn and theWRITE_ONCE()writes, so a J873g row at this head is requested.Risk: two-way · T8152 (J873g, J804) GPU mailboxes only. Every changed runtime path is under
is_ascwrap_v8; other ASC mailboxes keep their code.Not yet: J873g row at this head (boot, GPU mailbox recv interrupt counts rise in
/proc/interrupts, GPU smoke, no storm, unbalanced-IRQ or GPU-timeout messages).