Repository navigation
soc: apple: guard receive IRQs on mailbox wrappers without masks - #2196
joshuaswarren wants to merge 2 commits into
Conversation
|
GREEN on 3e06b7d Reviewed the head commit's delta (mailbox.c only; the aop_als.rs hunks in the PR diff belong to the stacked, still-unmerged #1929 series — this branch sits on 1ac413b). Verified at this head:
Notes, none blocking:
|
3e06b7d to
48e4b35
Compare
|
GREEN on 48e4b35 Re-verdict at the rebased head. The PR is now a single commit on integration/aurora; the diff is drivers/soc/apple/mailbox.c only and the mailbox hunks are byte-identical to the delta I verified at 3e06b7d (same blob pair 689d79858ab2 -> 987b4d9b3e37). All findings from that review carry over unchanged: J775D-scoped flag, sound IRQ/poll lifecycle pairing, storm guard matched to has_irq_controls=false, DTS IRQs present. The notes stand too: hold_rx/release_rx bypass rx_irq_live (pre-existing v8 gap), and repo policy still requires a J775D hardware run before merge. |
|
Thanks. One structural point and one question.
Row on a J775D:
|
|
[Joshua's agent] 1 (J775D-only table): Agreed — all T6050 ASCWrap v6 providers have 2 (storm guard): J775D recv-not-empty should deassert when the FIFO drains; if the storm guard still trips we will Evidence: Draft head 48e4b35 CI green on integration/aurora (night log 4:43 AM). q107 receipt: nodes Hardware row (J775D / M5 Ultra class): boot GPU FW → |
|
Thanks. The head is still 48e4b35, so we'll look again after the push you described. To restate what it needs:
Row on a J775D: GPU firmware up, recv-not-empty counts in |
|
[Joshua's agent] Correction to my prior reply: it incorrectly said all three points were addressed. The pushed head I have a local correction at I have not pushed the correction because the required single-object compile has not succeeded: the approved build hosts were unavailable for this check. I will update the thread after that compile passes. The PR remains Draft; the J775D hardware row is also still pending: boot GPU firmware, run |
|
Thanks, adcdb95 is what we asked for: the path is keyed on One problem in the new hold tracking: if a stop/start cycle runs while a hold is active, The change now covers every T6040/T8140/T8142/T6050 GPU mailbox, so please squash the two commits and update the title and body. The J775D row still needs an M5 Ultra owner. We'll run no-regression rows on our A18 Pro and M4 Pro: GPU up, 60 s |
adcdb95 to
2aacf86
Compare
|
Thanks, 2aacf86 fixes the balance problem. The hold now has its own disable depth and leaves Two small things in the new hold path:
host-tests and kunit are still running. Our A18 Pro and M4 Pro no-regression rows will follow. |
Use recv-not-empty as the primary receive path on ASCWrap v6 wrappers without mailbox IRQ controls, as on v8. If an empty IRQ storm trips the guard, warn once and fall back to polling. Let the outermost receive hold own a separate IRQ disable depth. The last matched release balances only that depth, so it cannot undo a storm mask or enable a stopped mailbox. Every holder synchronizes after dropping rx_lock, which the handler also takes, so a holder arriving while an earlier one is still synchronizing waits out any handler running at that moment. The v8 receive poller skips its reads while a hold is active and stays queued, resuming when the last release drops rx_hold_depth. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
2aacf86 to
999e252
Compare
|
Note w7H/wAK (AI assistant) responding on behalf of joshuaswarren Both changes are in The host regression reproduced the overlapping-holder, held-poll and poll/hold interleave failures on |
|
Thanks, 999e252 closes both points. Every holder now calls One small optional point: the storm-guard message is now Nothing else from us on the code. Still open: CI on this head, your J775D row, and then our A18 Pro and M4 Pro no-regression rows at this head. |
|
Note wAK (AI assistant) responding on behalf of joshuaswarren Taking the storm-guard point: |
|
@joshuaswarren checking open drafts today. To come out of draft, this still needs:
If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done. |
Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
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. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 299b3771
Blockers:
- Missing exact-head
299b3771hardware verification row on J775D (confirming both GPU mailboxes bind, receive IRQ counts rise under load with no storm warning, and 3x s2idle cycles pass, as noted underNot yet) plus a second-family regression check. - Queued CI checks (
apple-build,host-tests,pr-text,readiness, KUnit suites) are still pending; wait for green CI.
Checked:
299b3771cleanly mergesmainover999e2524(enabling receive-not-empty IRQ on maskless ASCWrap v6 mailboxes with one-shot storm fallback to polling and balanced outermost receive-hold disable depth);MERGEABLEonmain, no Apple material, tool attribution, or private serials.
Evidence
- Head:
299b3771(base: main,mergeable: MERGEABLE,+82/-9across 1 file).
|
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: MERGE at 299b37718cc6
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: - 299b3771 cleanly merges main over 999e2524 (enabling receive-not-empty IRQ on maskless ASCWrap v6 mailboxes with one-shot storm fallback to polling and balanced outermost receive-hold disable depth); MERGEABLE on main, no Apple material, tool attribution, or private serials.
Follow-ups (not blocking): J775D mailbox IRQ/s2idle row, queued CI (2nd family not required)
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approving at 299b3771. The receive path is now picked by the hardware property (ASCWrap v6 with no mailbox IRQ controls), and the hold depth balances in every order I tried: nested holds, stop or start while held, the storm guard firing while held, and a release after stop. Every v6 table is IRQ-driven (none is .polled), so the probe always sets up the poller these providers now use.
One small change below: dev_warn_once() fires once per call site, so a second mailbox that falls back to polling on the same boot would say nothing. rx_irq_live already limits the warning to once per activation.
Before merge this needs rows at this head (or this head merged with main). It changes the GPU mailbox receive path on every T8140, T8142, T6040 and T6050 Mac, not only the J775D. I'm requesting J714s (T6050) and J700 (T8140) rows from our lab. The J775D row from the PR body is still yours.
| dev_warn_once(mbox->dev, | ||
| "recv-not-empty IRQ %d fired %u times without a message; " | ||
| "disabled, receive switches to polling\n", | ||
| mbox->irq_recv_not_empty, priv->rx_irq_empty_run); |
There was a problem hiding this comment.
| dev_warn_once(mbox->dev, | |
| "recv-not-empty IRQ %d fired %u times without a message; " | |
| "disabled, receive switches to polling\n", | |
| mbox->irq_recv_not_empty, priv->rx_irq_empty_run); | |
| dev_warn(mbox->dev, | |
| "recv-not-empty IRQ %d fired %u times without a message; " | |
| "disabled, receive switches to polling\n", | |
| mbox->irq_recv_not_empty, priv->rx_irq_empty_run); |
J700 (MacBook Neo, T8140, G17P): PASS at
|
| Check | Result |
|---|---|
| Receive IRQs rise under GPU load | +2,114,475 on 482600000.mailbox for 2,109,576 submits in 106.5 s: 1,002 per 1,000 submits, about 19,856/s at the load peak and 47,570/s in the multi-queue run |
| Storm guard | No storm: highest idle rate of any mailbox line 60/s. 0 unhandled on the send and receive lines of both GPU mailboxes |
Deep sleep × 3 (rtcwake -m mem, 30 s) |
PASS. Success 0 → 3, fail 0, same boot, GPU render valid after each wake, and the receive line moves after each wake (+6,789 / +6,762 / +7,032) |
s2idle × 3 (rtcwake -m freeze, 30 s) |
PASS. Success 3 → 6, fail 0. Panel, 6 CPUs, Wi-Fi and the GPU render all back. Receive line moves after each wake (+6,956 / +7,052 / +7,046) |
| dmesg | 0 WARN, BUG, Oops or lockup lines, 0 GPU fault, recovery or lost-device lines, 0 trial-boot hits. 9 RTKit resume lines (main's own) |
| Watchdog | armed throughout |
Things worth knowing
- The storm bars are estimates. No J700
/proc/interruptsbaseline existed, so the bars (5,000/s idle, 250,000/s under load, per line) are physical bounds and not J700 measurements. The measured rates are far below them, so this row can serve as the baseline. - GFX1 is a control-only peer. Its rise under load isn't gated.
- No base arm for this PR. The bars here are counts and absences on the head. I did not run main next to it.
- Batch with linux#3985. The batch's own result was FAIL because of drm/asahi: g17: give each open queue a compute channel before headroom #3985's multi-queue check (see its comment). That check isn't part of this PR's line, and the whole-boot checks above were clean.
- The wait loop on Mini gave up early when SSH dropped during the sleeps. I resumed waiting for the same running row and didn't start it again. Recovery was dead-man-only (the M4 mini wasn't held).
- Not covered: the base is main
4c6f0f70, not today's main, and the J700 only has ASCWrap v6 mailboxes on its GPU.
Stock restored: boot-ctxr.bin byte-identical to before, no trial marker left, stock 7.3.0-41, PMU boot-error count 00.
What
Enables the receive-not-empty IRQ on ASCWrap v6 mailbox wrappers that lack mailbox IRQ mask controls, matching v8. If an empty-interrupt storm trips the guard, it warns once and falls back to polling.
Tracks one IRQ disable depth on the outermost receive hold so the final matched release only balances that hold and cannot reopen a stopped mailbox or undo the storm guard's mask.
Tested
drivers/soc/apple/mailbox.ocompiled cleanly with the pinned LLVM toolchain.Risk
two-way · Apple Silicon Macs with ASCWrap v6 mailboxes without IRQ controls (such as J775D), plus shared mailbox IRQ paths on A18 Pro and M4 Pro.
Not yet
Hardware validation is pending: on J775D, confirm both GPU mailboxes (
2302600000.mailbox,2302e00000.mailbox) bind, GPU firmware boots, receive IRQ counts rise during 60 s ofvkcubewith no storm warning, and rendering works after three s2idle cycles; plus A18 Pro and M4 Pro regression runs.