Skip to content

[follow-up to #65] soc: apple: mailbox: propagate IRQ lookup errors - #196

Merged
RyanTheTide merged 3 commits into
aurora-wipfrom
fix/pr65-review
Oct 8, 2026
Merged

RyanTheTide merged 3 commits into
aurora-wipfrom
fix/pr65-review

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Propagate the actual RX/TX IRQ lookup error, including deferred probe, while preserving ENXIO as the accepted absence of the optional send-empty IRQ. The proposed absent-IRQ synchronization failure was disproved: the IRQ core treats an invalid descriptor as a no-op.

Follow-up to #65; original contributor commits are preserved. These fixes are based on public Linux/PR source and Linux-side tests.

Validation: targeted arm64 driver build passed (object checks only); strict checkpatch passed for the final code changes with only the required Assisted-by trailer diagnostic excluded. The real IRQ-core synchronization check passed before and after the defensive guard.

Hardware qualification on aurora-edge is pending. No boot, suspend, fault-injection or firmware recovery pass is claimed. The publication gate is separate from runtime acceptance.

🤖 Generated with Claude Code

joshuaswarren and others added 3 commits October 1, 2026 23:08
The T6021 (M2 Max) ANE coprocessor mailbox is an ASC mailbox, but only
one of its interrupts is known: the Apple device tree gives the ANE a
single interrupt line. The binding requires the four ASC mailbox
interrupts in a fixed order, so a node for this mailbox fails
dtbs_check.

Add the apple,t6021-ane-mailbox compatible with the apple,asc-mailbox-v4
fallback. For it, recv-not-empty is the only required interrupt;
send-empty, send-not-empty and recv-empty may follow in that order.
Without send-empty, the OS must poll the FIFO status before it sends.

The other variants keep their constraints. The four-interrupt rule moves
into a condition that excludes the ANE and AOP setup mailboxes, and the
AOP setup mailbox states its minimum of two interrupts, which the
top-level limit gave it before.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The T6021 (M2 Max) ANE coprocessor mailbox has one known AIC line, which
the device tree names recv-not-empty. apple-mailbox insists on a
send-empty IRQ as well, so it cannot bind that mailbox.

Look send-empty up with platform_get_irq_byname_optional(). When the
node has none (-ENXIO), do not request it, and let apple_mbox_send()
wait for FIFO space by polling the A2I control register, the way its
atomic path already does (100 us steps, 500 ms timeout, under tx_lock).
Any other lookup error still fails the probe with -ENODEV.

A mailbox whose node names send-empty takes the old path unchanged: the
IRQ is requested at the same point with the same flags and name, and a
non-atomic send still sleeps on tx_empty. All 71 apple-mailbox nodes in
arch/arm64/boot/dts/apple name send-empty today.

The Rust wrapper (RUST_APPLE_MAILBOX) needs no change. It only calls
apple_mbox_get_byname(), apple_mbox_start(), apple_mbox_send() and
apple_mbox_stop(), and never reads the IRQ fields, so a Rust client
gets the poll through apple_mbox_send().

An equivalent change ran on an M2 Max lab kernel (Asahi 7.1.13 base)
from 2026-09-24 to 2026-09-30, where apple-mailbox bound the
one-interrupt ANE mailbox. The FIFO-full poll itself did not run there:
with the ANE firmware in use (from macOS 13.5), the host sends no
mailbox message after probe.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Preserve the receive and send-empty IRQ lookup errors, including deferred
probe, rather than replacing them with ENODEV. Keep ENXIO as the supported
absence of the optional send-empty IRQ for polling transports.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 5c269a5 into aurora-wip Oct 8, 2026
@RyanTheTide
RyanTheTide deleted the fix/pr65-review branch October 8, 2026 10:22
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