Repository navigation
accel/ane: run the Neural Engine on T6041/J616c - #920
Merged
RyanTheTide merged 13 commits intoNov 5, 2026
Merged
Conversation
astaff
force-pushed
the
t6041/j616c-ane-h16
branch
from
November 4, 2026 00:40
b90b543 to
9144639
Compare
RyanTheTide
requested changes
Nov 4, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
This one is in good shape. Each driver commit is small, explains its measurement and comes with KUnit coverage (ANE boot and transport suites 205/205 here, up from 201).
Notes on the commits:
- Terminal ring (6339bbf). Draining channel 0 is clearly right, since macOS and H14 serve it, and the type-2 check keeps it inert elsewhere. It also runs on the M4 Pro, so we tested it there across 21 boots: ANE startup completes as before, and our known M4 Pro startup stall is unchanged (2 of 20 against a 15% base rate). So it isn't a regression, and not that fix either.
iommu_map_sgtable()(dcda6e4). Looks correct. The 16 KiB blocks are IOMMU-page aligned, and a failediommu_map_sgtable()has already unmapped its partial work. Can you confirmm->mappedalways equalssizenow, and that the unmap path doesn't rely on per-block granularity?- dfd158b, b3d1cca, 021c9b6 are fine.
Required fixes
- Signed-off-by (hard blocker). None of the 6 commits has a
Signed-off-by:. Please add yours afterAssisted-by: LLM(git rebase --signoff). - Split from PR 525. The branch carries all 14 commits of #525 underneath, but only the last commit (the J616c ANE DT, 9144639) needs it. Please put the five
accel/anedriver commits in their own PR based directly on integration/aurora. They help the M4 Pro too and don't need to wait for 525. The DT commit can follow once 525 lands. - Benchmark for the perf claim. dcda6e4 says twenty program maps go from about 10.3 ms to 2.0 ms. Please post the command you measured with, so we can reproduce it on the M4 Pro. Perf changes need a repeatable benchmark here.
Reuse the existing SoC and PMGR descriptions as the shared T604x base. Keep the M4 Pro DRAM class in t6040.dtsi on top of it. The J614s and J616s compiled trees keep every node and property unchanged. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Describe the Max CPU, OPP and register-window differences on the shared base. Preserve the qualified J616c node and property values. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Move identical register-window constructors into a family helper. The T6040 and T6041 initialization-data checks retain their exact values. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Select a static 25F84 profile and admit the normalized loaded image measured in three qualification boots. Remove exploratory overrides and unknown-image admission from the support path. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Accept 26.5.2 firmware on the T6041 display controllers and add headerless powerlog parsing. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
A DCP commit signals flip_done from its swap completion, after the rest
of the commit tail has run. drm_atomic_helper_commit_tail_rpm() waits
with drm_atomic_helper_wait_for_vblanks(), but appledrm never calls
drm_vblank_init(), so drm_crtc_vblank_get() fails and that wait returns
at once. A blocking commit therefore returned before flip_done, and
drm_atomic_helper_setup_commit() refuses a nonblocking commit on the
same plane until flip_done. A page flip right after drmModeSetCrtc()
failed with -EBUSY ("busy with a previous commit"), which is what
glmark2-es2-drm hit on the J616c.
Wait with drm_atomic_helper_wait_for_flip_done() instead. The rest is
the sequence of drm_atomic_helper_commit_tail_rpm(), in its order. That
helper makes no runtime PM calls: its name stands for enabling CRTCs
before committing active planes, and this keeps that.
The change is not scoped to the J616c. Neither the empty vblank wait
nor the -EBUSY check depends on the SoC, so a per-machine tail would
only leave the race on the others. On every appledrm machine:
- A blocking commit returns after the swap completes and holds its
modeset locks until then.
- A nonblocking commit's worker finishes later. The next commit was
already held back by flip_done, so the flip rate does not change.
- Nothing waits when flip_done is complete early: CRTCs that stay off,
legacy cursor updates, and the T8132 backend, which sends the event
from its flush.
- A lost event costs 10 s and an error in the commit that lost it. The
next commit's dependency wait already has the same bound, so this
adds no new hang.
Framebuffer lifetime does not depend on this wait: displaced scanout is
already retained until its swap completes.
Seen and tested on the J616c only.
Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Patching the AOP boot arguments read and rewrote the whole table with memcpy_fromio() and memcpy_toio(), which choose their access widths from alignment and length and write back every byte. Add an AopHwConfig setting for explicit access: read the table in aligned 32-bit words, rounded out to word boundaries so that neighbouring bytes are kept, write only the words that changed and read each one back. This was chosen for the J616c bring-up so that the first accesses to its AOP SRAM had a known width. It does not fix an observed fault: the bulk copy was not run on that machine. The setting is on in HW_CFG_T6040, so it is not J616c-only. t604x.dtsi gives the J614s, J616s and J616c the one apple,t6041-aop compatible, and HW_CFG_T8132 (J713) is a copy of HW_CFG_T6040. Scoping it to the T6041 would take a second compatible, which changes the T6040 device trees, or a machine check. On those machines the values written do not change. The access width does, and there are new ways to fail the probe: -EIO when a word does not read back, and -EINVAL for an empty table or one whose rounded end passes the window. Every other SoC keeps the bulk copy. Synthetic MMIO checks cover malformed tables, bounds and failed readback. Run on the J616c only. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Describe the six amplifiers and headphone jack in the J616c board DT. Stop playback when the speaker protection lease is lost on SN012776 cards fed by the AOP. Until now a lost lease only clamped the amp gains, and the stream kept running with its protection daemon gone or stuck in a stalled sense capture. The clamp stays; the stream now also goes to XRUN, so its client sees the loss. This is shared macaudio code and it is stricter than before. It applies to the J616c, the J616s and the J713. The J614s uses the same condition but binds no speaker link, so it has no lease and never gets here. Narrowing this to the J616c would give machines with the same amps and the same AOP path different protection, and would take a new match entry for it. The stop covers every playback stream of the speaker card, which on these machines carries only the speaker stream. The headphone jack is a card of its own and keeps playing. It is a stop, not a refusal: a client that prepares again plays at the clamped gain until the lease returns. It fires only when the speakers go from unlocked to locked, so not at boot, and not for the kernel's own lock across system sleep, where ASoC suspends the streams itself. A daemon that exits cleanly also loses the lease. Other amps and non-AOP SN012776 cards behave as before, and the MAX98360A path still stops only its software-gain streams. Lease loss was tested on the J616c only. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The T6041 AVD shares its "apple,t6041-avd" compatible with T6040, which holds HEVC back until the firmware lists it. Give the T6041 node a more specific compatible and a variant that holds nothing back, so HEVC is also available on firmware that publishes no codec list. A firmware that does publish one still limits the set. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Build the production initialization objects with their soft-float types and compare constants with explicit capture inputs. Keep T6040 per-chip calibration validation separate; include no captures or local defaults. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
m1n1 compares DT CPUs with its physical MPIDR enumeration. Appending the Max cores to the Pro topology put CPU 9 out of order and stopped boot before kernel entry. Define the full family topology in hardware order and remove the extra cores from T6040. Check the compiled DTB order for both SoCs. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
macOS on J616c writes 0x1c890 = 1 and 0x1c918 = 0 for its tiling passes, where the shared firmware profiles write 0x200440 and 4. Do the same in T6041's 25F84 build and leave the shared profiles unchanged. 0x1c9a8 stays at the shared 0x3c; macOS writes 0x5c here. This does not fix the 25F84 reason-0 restarts under concurrent rendering. They still occurred with these values on an earlier base, also with 0x1c9a8 = 0x5c. Ran on J616c with 25F84, with PRs 732, 749 and 920 and Mesa ca90d8c1919, serial rendering off and the firmware log on: three boots of niri, DMS and 20 Whisper runs each, with no GPU recovery. Add KUnit coverage for the policy boundary and constructor output. Link: aurora-silicon#525 (comment) Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
As on J616s, add the two firmware reservations the boot loader fills from this boot's ADT, and the ane alias. J616c's loader also enables the nodes it fills, so they stay disabled here. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
astaff
force-pushed
the
t6041/j616c-ane-h16
branch
from
November 5, 2026 02:49
9144639 to
c22c1fc
Compare
RyanTheTide
approved these changes
Nov 5, 2026
RyanTheTide
left a comment
Contributor
There was a problem hiding this comment.
Thanks for splitting the driver side into #950, that one is merged already. This is just the J616c DT now and it matches the J616s layout, with the nodes disabled until the loader fills them. dtbs_check on the J616c DTB shows only the ANE property warnings the J616s already has. Merging!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The M4 Max's Neural Engine is the same H16 as the M4 Pro's, at the same addresses. J616c only needs the firmware reservations and alias to use the merged driver.
What
t6041-j616c: as on J616s, add the two firmware reservations the boot loader fills, and theanealias. The nodes stay disabled here.Stacked on #525. The driver changes this device needs are in #950.
Testing
Kernel is the same merge as #525's proof, with a local boot loader that fills and enables the ANE nodes.
conv3x3output equals the macOS reference over 200 runs, with 0 faults.Limits
🤖 Generated with Claude Code