Skip to content

apple-sio: publish protocol-9 control state first and size DMA arrays by entry count (M2 bring-up crash) - #792

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
fix/sio-bringup-race
Nov 1, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
fix/sio-bringup-race

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

M2 SIO bring-up: publish protocol-9 control state first, size the DMA arrays by entry count

On the M2 (T8112) the SIO co-processor occasionally crashed during bring-up, about 2 boots in 119, with an SError right after "SIO protocol v9". In all four saved crash histories the firmware had acknowledged STARTED and eleven SETUP messages, and the one unacknowledged request was parameter 0x23, the shim table length.

This change:

  • publishes the protocol-9 control state (panic buffer, map ranges, tunables, shims, device types) before the performance state and the DMA arrays, still waiting for each ACK and stopping at the first failure. Other protocol versions are unchanged.
  • treats parameters 2 and 0x0c as entry counts, which they are, and allocates 0xaaa 12-byte segment entries and 0x1b80 16-byte response entries. Before, the buffers were sized in bytes while the firmware was told the same numbers as entry counts, so the firmware could write past them.
  • keeps the published buffers until an acknowledged firmware shutdown.

Tested

  • KUnit (arm64 16K) 15/15 for apple-sio, host tests 158/158, full fleet build of the branch (7.3.0-aurora-siofix).
  • M2, 30 warm boots on that kernel: SIO probed every boot, 0 co-processor crashes, journalctl -b -p 3 empty every boot, both audio cards present, speakerguardd active. No audio was played.
  • At the old rate (about 1.7%) 30 clean boots is not yet proof that the crash is gone; it shows no regression. The rate will keep being counted on the ref Mac fleet boots after this lands.
  • M2 bisect earlier tonight: 0 crashes in 20 boots on aura main, so the bootloader is not the trigger.

🤖 Generated with Claude Code

T8112 SIO can fail with an SError while consuming the DMA-shim table.
The mailbox history already contains STARTED and matching SETUP ACKs;
the outstanding message is the shim-table length, parameter 0x23. A
second wait for STARTED cannot establish the missing ordering.

The loader currently publishes response-array and performance state
before map ranges, shims and device types. Use the protocol-9 control
publication sequence from the publicly posted t4333 SIO implementation:
panic buffer, map ranges, tunables, shims, device types, then performance
state and DMA arrays. Keep the existing synchronous ACK after every
parameter, reject malformed control lists before publication, and stop
at the first failed ACK. Leave other firmware protocols unchanged.

Protocol-9 parameters 2 and 0x0c count entries, not bytes. Allocate
0xaaa 12-byte segment entries and 0x1b80 16-byte response entries rather
than advertising counts backed by byte-sized allocations. Replace the
loader's response mapping with a zeroed coherent allocation and keep
published buffers until an acknowledged firmware shutdown. Preserve the
existing channel and transfer descriptor layouts.

Consolidate the public candidate at 76a2b41 on the current aurora-wip
base. Extend its KUnit coverage to preserve all reordered values and to
stop publication on failure at every control-table ACK boundary.

The firmware-internal race remains an inference from the crash boundary;
M2 boot qualification is required before merging this change.

Link: 79a9ee4
Link: 76a2b41
Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit 97526d9 into aurora-wip Nov 1, 2026
@RyanTheTide
RyanTheTide deleted the fix/sio-bringup-race branch November 1, 2026 13:22
mchalunderscore pushed a commit to mchalunderscore/linux that referenced this pull request Nov 4, 2026
…tion/aurora

Bring integration/aurora up to aurora-wip 52f0a6b, the source of
7.3.0-aurora-fleet14h, promoted on all four machines on 2026-11-02.
The range also covers the fleet14g source b35adc7. It adds aurora-silicon#792,
aurora-silicon#750, aurora-silicon#783, aurora-silicon#784, aurora-silicon#793, aurora-silicon#774, aurora-silicon#794, aurora-silicon#796, aurora-silicon#798, aurora-silicon#800, aurora-silicon#802 and aurora-silicon#801.
No conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.

1 participant