Skip to content

accel/ane: H16 26.5.2 firmware profile and transport fixes - #950

Merged
RyanTheTide merged 5 commits into
aurora-silicon:integration/aurorafrom
astaff:accel/ane-h16-26.5.2
Nov 5, 2026
Merged

RyanTheTide merged 5 commits into
aurora-silicon:integration/aurorafrom
astaff:accel/ane-h16-26.5.2

Conversation

@astaff

@astaff astaff commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Why

Split from #920: none of this is specific to T6041. The driver refuses the resident image macOS 26.5.2 leaves in the preload, and the H16 transport never serves the firmware's text log.

What

  • Add an H16 26.5.2 profile. Only the image digest is new.
  • Drain the terminal ring whenever the transport waits. On the M4 Max a first command stalled with a message waiting at the ring's head.
  • Read DART fault addresses only on a fault.
  • Stop zeroing surfaces twice, and map each surface with one iommu_map_sgtable() call.

Based directly on integration/aurora.

Testing

Kernel is the same merge as #525's proof, with a local boot loader that fills and enables the ANE nodes. conv3x3 output equals the macOS reference over 200 runs, with 0 faults.

The digest also covers a TEXT region iBoot fills in. It has been stable across boots of one machine and hasn't been checked on another.

Review questions from #920

  • m->mapped always equals size on success: iommu_map_sgtable() maps the whole table or unmaps and fails, and a failure returns before m->mapped is set. The unmap path unmaps m->mapped bytes from m->dva as one range, so it doesn't rely on per-block granularity.
  • Benchmark: the commit no longer claims a number. The earlier 10.3 ms to 2.0 ms came from one A/B pair on a private debugfs job harness, timing whole map operations including allocation, zeroing and vmap, so there's no public command to post.

🤖 Generated with Claude Code

macOS 26.5.2 leaves a different resident image in the Neural Engine's
preload on the M4 Max. Its DATA framing, patchbay cells and cleared
range match 25G83 and its boot values match the shared build, so only
the image digest is new. Without a profile the driver refuses the image.

Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The firmware logs text through channel 0, a unidirectional type 2 ring.
macOS's interrupt handler drains it and H14 serves it during boot, but
the H16 transport never does. On the M4 Max a first command stalled with
a message waiting at the ring's head; with the ring served, startup
passes after about fifty messages.

Drain the ring whenever the transport waits. The text is discarded, and
a channel of another type is left alone.

Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
ane_h16_faults() runs on every poll, now including the 2 us busy steps,
and each call reads the two address registers of all three DARTs before
it knows whether they will be logged. Read them only when they are.

Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Every backing page comes from alloc_pages(__GFP_ZERO), so the memset
after vmap() clears them a second time through the new alias.

Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Mapping every 16 KiB block separately syncs the DART once per block. A
single iommu_map_sgtable() does it once, with the same pages, protection
and DVAs.

Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
@astaff
astaff force-pushed the accel/ane-h16-26.5.2 branch from d16c093 to 18d90e4 Compare November 5, 2026 03:35

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the split makes this easy to take, and the m->mapped answer is what I hoped. Fair enough on the benchmark, dropping the number from the commit is the right call.

KUnit ANE boot and transport are 205/205 here (base 201/201). W=1 adds nothing in accel/ane. On our M4 Pro (J616s), the one-shot boot of the merge train came up with "H16 READY" and the accel node ready, no startup stall that boot, and nothing new in the kernel log next to fleet16. Merging!

One thing for later: the 25F84 digest covers a TEXT region iBoot fills, so a second M4 Max on 26.5.2 would be a good check that it really is stable across machines.

@RyanTheTide
RyanTheTide merged commit a892abb into aurora-silicon:integration/aurora Nov 5, 2026
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