Repository navigation
arm64: dts: apple: describe the T603x Neural Engine; accel/ane: T603x clean refusal - #4022
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
RyanTheTide
left a comment
There was a problem hiding this comment.
The replacement still carries the binding failure from #2331. For both T6030 and T6031, the firmware-property exclusion in apple,ane.yaml applies because neither compatible is in its allowlist. It forbids apple,ane-type and apple,firmware-preloaded, which the new branch requires for the same nodes. A T6030 or T6031 node cannot satisfy both branches. Include both compatibles in that allowlist and validate the T6030 and T6031 nodes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a51b3e8dcb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| interrupt-parent = <&aic>; | ||
| interrupts = <AIC_IRQ 577 IRQ_TYPE_LEVEL_HIGH>; | ||
| power-domains = <&ps_ane_sys>; | ||
| status = "okay"; |
There was a problem hiding this comment.
Keep the unqualified ANE's DARTs disabled
On M3 Pro with CONFIG_APPLE_DART enabled, these nodes probe independently of the ANE driver, so the new ANE preflight refusal does not prevent hardware access. The generic path in apple_dart_probe() calls apple_dart_hw_reset() for unlocked DARTs, disabling DMA and clearing their translation tables before any ANE backend has acquired ownership. This also reintroduces the boot-hang condition explicitly documented in t8122-peripherals.dtsi:515–518: enabled ANE DART nodes were reported to hang an M3 Pro. Keep these suppliers disabled until a qualified acquisition path can safely initialize them; refusing only the ANE driver is insufficient.
Useful? React with 👍 / 👎.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at a51b3e8dcbc2b8801ae69ed23b8053445759f902
Blockers: numbered below. 1-3 come from the rebase; the T603x device-tree files are the same as at #2331's 2bda8f1b.
Checked: every T603x register window, interrupt, power state and ane-type against the restore-image ADTs of all seven boards; driver paths; binding; builds of this head merged with main. No AI attribution, no Apple material, no runtime switch, no board gate (selection is by compatible).
drivers/accel/ane/ane_fw_platform.c:193-194does not compile. The conflict resolution lost};, the blank line and/*betweenane_t8112_platformand the T603x comment (error: use of undeclared identifier 'M3', 3 errors), so no kernel withCONFIG_DRM_ACCEL_ANE=mbuilds. It starts in75824cf3. Fix: put those three lines back (as in #2331's2bda8f1b).t8122-peripherals.dtsi:464-534andt8122-pmgr.dtsidescribe the T8122 ANE a second time.mainalready has it.dtcmerges the two copies silently: the T8122anenode gainsmboxes, and a secondstatus = "disabled"comes after the first block. It starts in00c42a75. Fix: drop both T8122 hunks; with that, all five T8122 DTBs are byte-identical tomain.apple,ane.yamlrejects every T603x node.CHECK_DTBSgives 18 new errors over the seven T603x DTBs (hosted dt-checks reports the same 18).- Add
apple,t6030-aneandapple,t6031-aneto thenot: contains:list (afterapple,t8132-ane). - Remove the second
apple,t8122-anefrom the list with theinterrupt-names: falseclause. A repeated enum entry is a meta-schema error indt_binding_check. - Add
apple,t8122-aneto the newmboxes: falselist, which it was in before this PR. - Drop the added T8122 example. It has no
apple,firmware-preloadedand noapple,dapf-ranges, both required.
- Add
- The rows on #2331 don't carry over. Four of the eleven files differ from
2bda8f1b(apple,ane.yaml, both T8122 files,ane_fw_platform.c), and none of the rows covers sleep or idle power. The nodes are enabled, so the DARTs and the mailbox probe on every T603x Mac whatever the ANE driver does.00c42a75itself cites a report of an M3 Pro hanging at boot with its ANE DARTs enabled. Needed at the fixed head, default command line:- T6030, 27.2 stub (J516s), again, now with idle and sleep.
- T6030, 14.7 stub (J514s). The earlier run was a 7.2.11 kernel with the out-of-tree module.
- M3 Max (any of J514c, J516c, J514m, J516m) and M3 Ultra (J575d). No boot with these nodes enabled has been posted for any of them. If one can't be had soon, set the T6031 and T6032 engine, mailbox and DART nodes to
disabledhere and enable them in a follow-up with the row; T6030 can then land on its two rows.
Please fold 1-3 into the commits that introduced them rather than adding a commit on top: from 00c42a75 on every commit carries the T8122 copy, and from 75824cf3 on accel/ane doesn't build, which breaks bisecting on main. While there, 00c42a75's message still says everything stays disabled. The body needs Tested: and Risk: lines, and "review and boot rows apply unchanged" should go. #2331 can be closed once this head is good.
Not blocking, worth taking in the same push
apple,firmware-iovason T6030 is the 14.x layout only. The T603x ANE firmware has a 0xb0000-byte TEXT segment in 14.6.1 but 0xc8000 in 27.2, so on a 27.2 stub DATA is at0x100000c8000, as on T8122. A static value can't be right for both. aura writes this property from the ADT segment ranges for the compatibles it knows, so leave it out of the node and let aura supply it. Nothing reads it while the driver refuses T603x.memory-region: falseandmemory-region-names: falsecontradict that hand-over: aura adds both. Drop them. The compatible list in aura'sdt_set_ane_firmware()needs the two T603x entries before any start works.apple,firmware-preloadedon T6031/T6032. The ADTs show the RTKit ANE (ASC windows, nub, mailbox interrupts) only on 27.2. In 14.6.1 the T603x ANE isane,t8020with the engine interrupt alone. The J514s observation is the only basis for "preloaded", so say so in the comments, or set the property only where it was seen..soc: use0x6030/0x6031, with.ane_type = 0xc0/0xe0, as the other platforms do. The refusal line now printsSoC 0xc0.- T6031 DAPF is in the restore ADTs of J514c, J516c, J514m and J516m, identical in 14.6.1 and 27.2:
0x292280520-523,0x2922805a0-5c3,0x292829a9c-a9f,0x38d468000-003,0x40a468000-003. J575d die 0 adds0x23c945c000-003. - T6031
ANE-SYS-VhasAFRas a second parent in the ADT, and the node doesn't referenceps_afr. Wanted before the engine is started there. - The PWGATE comment says
aux-0 + 0x2b6c; the DAPF record isaux-0 + 0x2c6c. Please check which one is meant. - Question, for the rows: with the ANE never bound,
sync_state()stays pending on its five power domains, and a domain that is on at boot then stays on (genpd->stay_on), now without auto power management forane_sysandane_cpu. Are all five off at idle, asane_sysis onmain(J516s:off-0)?
Evidence
Merge of this head with main (5d506042; main is now 1ab453e8, which differs only in a workflow file; main has not touched the PR's files since its base).
| Check | Head | Head with blockers 1-3 fixed |
|---|---|---|
W=1 drivers/accel/ane/ (clang 23, arm64) |
3 errors | 0 errors, 0 warnings |
7 T603x + 5 T8122 DTBs, W=1 |
build, 0 new dtc warnings | build, 0 new; T8122 byte-identical to main |
CHECK_DTBS (apple schemas) |
18 new errors | 0 new |
dt_binding_check apple,ane.yaml |
meta-schema error (repeated enum entry) | clean |
| DART power-domain and sibling-drift checks | 0 new | - |
host tests ane / t6030 / pmgr (hosted-CI toolchain) |
- | 13/13, 12/12, 3/3 |
ADT comparison (27.2 26B123: all seven boards; 14.6.1: the six M3 Pro/Max boards):
- Engine, PMGR and aux windows, DART and DAPF windows, ANE and DART interrupts,
ane-type: identical to the nodes on every board and both builds. J575d die 1 does list0x2903c0000, as the comment says. - Mailbox interrupts: the ANE lists them in the SIO's order (559, 558, 561, 560 against SIO 908, 907, 910, 909), so the mapping taken from the SIO mailbox holds. The mailbox at ASC + 0x8000 rests on the same SIO comparison.
- T6030 DAPF: the five records match on J514s and J516s in both builds.
- T6030 power states
0xc000-0xc018and their parents match 27.2. In 14.6.1 the same four entries are marked virtual with an empty register mask, one more reason for a 14.7 row. T6031 matches in both.
Driver: the change is two match entries plus two empty platforms. ane_rtclient_init() calls ane_fw_platform_preflight() before it registers the driver, and that returns at boot_qualified, so no resource, power or MMIO access happens. Locking, remove, runtime PM and the H14-H17 paths are unchanged once the file compiles.
Other open ANE PRs: no file in common with #3817, #4026, #4027 or #4017. #3964 (ane_fw_platform.c/.h) and #3887, #4014, #3640 (T8122, T6031, T6030 peripherals) merge cleanly with this one in either order. None has to land first.
Row commands and pass criteria
Kernel and DTB of the fixed head merged with main, default command line (no pd_ignore_unused), CONFIG_DRM_ACCEL_ANE=m; the same on main for comparison.
cat /proc/cmdline; uname -r
journalctl -k -b | grep -iE 'apple-dart .*(30980|30981|30982|3c980|3c981|3c982)|ane|mailbox|SError|DART.*fault'
ls -l /sys/bus/platform/drivers/apple-dart /sys/bus/platform/drivers/apple-mailbox | grep -E '3098[012]|3c98[012]|309408|3c9408'
modprobe ane_t6021; dmesg | tail -2 # -EOPNOTSUPP and one refusal line per attempt
sleep 180; grep -iE -A3 '^(die[01]_)?ane_|ane_sys' /sys/kernel/debug/pm_genpd/pm_genpd_summary
for i in 1 2 3; do rtcwake -m freeze -s 30; done; cat /sys/power/suspend_stats/{success,fail}
journalctl -k -b -p err | wc -l; systemctl --failed
Pass: boots; 3 DARTs and the mailbox per die bind, 0 DART faults, 0 SErrors; only the refusal line is new at error level; at idle all ANE domains are off and DARTs and mailbox are suspended; 3/3 s2idle (plus one deep cycle where main supports it) with Wi-Fi, USB, display and audio back, and the ANE domains off again; battery power at idle (laptops) not higher than main; 0 failed units.
b992753 to
7f22811
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: changes needed at 7f228116582b. One of the four points from the review at a51b3e8dc is partly fixed. Of the 11 files, only apple,ane.yaml changed since then. The T603x nodes are the same blobs that were checked against the ADTs, so that comparison still holds, T6032's two engines included.
-
ane_fw_platform.c:194still does not compile (clang arm64, 3 errors:use of undeclared identifier 'M3'). Put};, the blank line and/*back after.safe_reset = false,. With those three linesdrivers/accel/ane/buildsW=1with 0 warnings. Hostedapple-buildwas skipped or is still queued here, so green CI won't show this. -
T8122 is still described twice.
mainalready has it, and J613 and J615 now run it (#4052 is merged). With this head the enabledanenode on both gainsmboxes = <&ane_mbox>, pointing at a disabled mailbox that no row has covered. Drop the hunks int8122-peripherals.dtsiandt8122-pmgr.dtsi. All five T8122 DTBs are then byte-identical tomain. -
Binding: the allowlist is fixed, three things are left.
dt_binding_checkstill reports the repeatedapple,t8122-ane(non-unique elements).apple,t8122-aneis missing from the newmboxes: falselist. The added T8122 example lacksapple,firmware-preloadedandapple,dapf-ranges. Patch below; with itdt_binding_checkis clean andCHECK_DTBShas no new lines on the seven T603x and five T8122 DTBs. A wrongane-typeis still caught. -
Enabled nodes with a driver that never binds can pin power domains through sleep. This answers the question from the last review from the code:
apple_pmgr_ps_probe()setsGENPD_FLAG_DEFER_OFFon a domain that is on at boot.genpd_must_defer()then refuses to power it off while any consumer is unbound, both at runtime (genpd_power_off()) and in system suspend (genpd_sync_power_off()).stay_onblocks the runtime path too, becausesync_state()never comes.ane_rtclient_init()refuses before it registers the driver, soanenever binds. Any of the five ANE domains that iBoot leaves on then stays on, andapple,no-auto-pmalso takes away the hardware gating thatmainsets onane_sys. On T6031 that keepsafnc5_lw0andafnc6_lw0on as well.- A domain that is off at boot is fine: the DARTs and the mailbox only hold it while active.
- No row says which case applies. The J516s row at
7c34ba8eshows all five withsync_state()pending, but not whether they were on.mainhas no such consumer and turnsane_sysoff.
Fix, preferred: set the engine, mailbox and DART nodes to
status = "disabled"in the T6030, T6031 and T6032 files, as T8122 has them, and enable them per board together with the driver support. Then nothing probes and nothing is pinned. That also settles the Codex P1 about the DART reset.Or keep them
okaywith the rows from the last review at the fixed head:pm_genpd_summaryat boot, at idle and after sleep, 3x s2idle, and one deep cycle wheremainhas it. J516s (T6030, 27.2), J514s (T6030, 14.7), one of J514c/J516c/J514m/J516m, and J575d. Boards booted with these nodes enabled so far: J514s (7.2.11, out-of-tree module) and J516s. No T6031, T6034 or T6032 board. -
Please fold 1-3 into the commits they belong to. As pushed, every commit from
70fa7891on fails to buildaccel/ane, and25eb2124on carries the T8122 copy.25eb2124's message still says everything stays disabled. -
Body: "Review and boot rows on #2331 apply unchanged" is not correct; neither row is on this tree.
Risk:should list T6030, T6031, T6034 and T6032, not only J516M.
Order: #4052 is already in main. #3887 goes next and needs nothing from here. With the T8122 hunks dropped, #4022 shares no file with it. The two apply cleanly together today as well. #4022 holds nothing else up.
Patch for 1 and 3 (on top of this head)
--- a/drivers/accel/ane/ane_fw_platform.c
+++ b/drivers/accel/ane/ane_fw_platform.c
@@ -191,6 +191,9 @@
.boot_qualified = true,
.firmware_preloaded = true,
.safe_reset = false,
+};
+
+/*
* M3 Pro (T6030) and M3 Max (T6031, also the T6034 package and both dies of
--- a/Documentation/devicetree/bindings/npu/apple,ane.yaml
+++ b/Documentation/devicetree/bindings/npu/apple,ane.yaml
@@ -497,7 +497,6 @@
- apple,t8122-ane
- apple,t8142-ane
- apple,t8132-ane
- - apple,t8122-ane
- apple,t6030-ane
- apple,t6031-ane
@@ -556,6 +555,7 @@
- apple,t8140-ane
- apple,t6041-ane
- apple,t6050-ane
+ - apple,t8122-ane
- apple,t8142-ane
- apple,t8132-aneand delete the last example (ane@310000000).
What was run
Head is 8 commits on main 8ec8740a1e6f, 0 behind. clang, arm64.
| Check | Head | With 1-3 fixed |
|---|---|---|
drivers/accel/ane |
3 errors | 0 errors, 0 warnings (W=1) |
| 7 T603x + 5 T8122 DTBs | build; T8122 differs from main |
build; T8122 byte-identical to main |
CHECK_DTBS (npu/apple,ane.yaml) |
0 lines (T603x, J613, J615) | 0 lines (all 12) |
dt_binding_check apple,ane.yaml |
meta-schema error (repeated enum entry) | clean |
Source read for point 4: drivers/pmdomain/apple/pmgr-pwrstate.c, drivers/pmdomain/core.c (lines 942-1030, 1437-1450), fw_devlink_count_absent_consumers(). No hardware was used.
No M3 device tree describes the Neural Engine. Add it to the SoC peripherals files, next to the other media engines: the engine, its ASC mailbox and its three DARTs on T8122, T6030 and T6031 (and so T6034), and both engines of T6032. Add the four ANE power states under ANE_SYS that the T8122 and T6030 PMGR files lack (T6031 already has them); on T8122 ANE_BASE depends on both ANE_TD and ANE_CPU, on T6030 on ANE_TD only. Every value comes from the hardware description of each board (all T8122, T6030, T6031, T6034 and T6032 boards agree per SoC) and our own capture of a J615 under macOS 27.2. The mailbox sits at the ASC + 0x8000 and its interrupts are ordered as on the SIO, which has the same ASC wrapper and whose mailbox is already described. On T6032 the second die's hardware description points one auxiliary window at the first die's copy, which that die's bus cannot address, so that window is left out there. Everything stays disabled: the accel/ane driver has no H15 support yet, and enabled ANE DART nodes were reported to hang an M3 Pro at boot in the omarchy-ane H15 bring-up work by Joshua Warren and testers, whose experimental overlays this follows. Co-developed-by: Ryan Murray <ryan@aurorasilicon.org> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org> Signed-off-by: Joshua Warren <joshua@warrenappliedlabs.com>
The T6030, T6031 and T6032 ANE nodes, their DARTs and their mailboxes stay disabled, matching T8122: an enabled node whose driver refuses to bind pins any power domain iBoot left on for the life of the kernel (genpd must-defer and stay_on both block the off path). They enable per board together with driver support. The iBoot preload happens on T603x the same as on T8122 (observed in the ADT on J514s), so the nodes carry apple,firmware-preloaded. PMGR gets apple,no-auto-pm on ps_ane_sys and ps_ane_cpu, the same fix 3082 shipped for the J615 CPU-stop failure: AUTO_ENABLE must not gate the ANE CPU behind the cold-started firmware. drivers/accel/ane: fail cleanly on T603x Add t6030/t6031 of-match entries pointing at unqualified platforms. ane_fw_platform_preflight checks boot_qualified first and returns -EOPNOTSUPP before any resource, power or MMIO access, so the engine probes, logs the refusal and stays idle. Signed-off-by: Joshua Warren <joshua@warrenappliedlabs.com>
The merged shared clause still carried t8122 and forbade apple,firmware-preloaded. T8122 has its own clause from main now, so the group shrinks to t6030/t6031, firmware-preloaded becomes required like the other preloaded H15 parts, and the stale t8122 duplicate clause goes away. Signed-off-by: Joshua Warren <joshua@warrenappliedlabs.com>
…ovas Add the five live J514s ADT dapf-instance-0 records and default preloaded firmware IOVAs (TEXT 0x10000000000, DATA 0x100000b0000) to the T6030 ANE node, matching the T8122 layout. Update the T6030 comment in ane_fw_platform.c while keeping the platform unqualified in this series. Signed-off-by: Joshua Warren <joshua@warrenappliedlabs.com>
…or T6030 The T6030 (M3 Pro, 14.7) preloaded ANE firmware maps __TEXT at 0x10000000000 (size 0xb0000) and __DATA at 0x100000b0000. Allow 0x100000b0000 in the apple,firmware-iovas second-element enum so CHECK_DTBS passes on t6030-j514s and t6030-j516s. Signed-off-by: Joshua Warren <joshua@warrenappliedlabs.com>
…lock The generic 'not H15' conditional listed every H15 compatible except the new T603x pair, so t6030/t6031 nodes hit apple,firmware-preloaded: false and apple,ane-type: false even though the T603x block requires both - dt-checks failed on t6034-j516m ane@3c8000000 with 'False schema does not allow True'. Add apple,t6030-ane and apple,t6031-ane to the exclusion enum. Signed-off-by: Joshua Warren <joshua@warrenappliedlabs.com>
cd146fe to
f9cb07e
Compare
|
All five points folded at
Verified here: |
|
Hardware check on J613 (T8122, macOS 27.2 So the |
Dropping the T8122 example also dropped the T8132 one before it and left an empty soc node. Put the T8132 example back unchanged. Signed-off-by: DjDeveloperr <hey@djdev.me>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: good at dcb002b6d136; all five points of the review at cd146fe0 are done.
- The sign-offs are there,
ane_fw_platform.cis the file that already built (hostedapple-buildatcd146fe0), both T8122 files are the same blobs as main's, and exactly the 20 ANE nodes went fromokaytodisabled. - One slip, fixed in
dcb002b6: with the T8122 example the T8132 one was dropped too, which left an emptysocnode. It is back unchanged. TheRisk:line now says two-way, which thepr-textcheck asks for.
Checked at dcb002b6: dt_binding_check on apple,ane.yaml is clean; the 7 T603x and the T8122 DTBs build with no apple,ane.yaml message; checkpatch --strict is clean; it merges cleanly with main f46dffad91fd.
On the J613 note above: dma-coherent for T8122 is already on main through #3887, so this PR no longer changes T8122.
Owed before merge: one J516s boot (M3 Pro, 27.2) at this head, ours: it boots, no DART fault or SError, ane_sys and the four new ANE domains are off at idle and after one s2idle. T6030 gains four power states, which is why. T6031/T6032 only gain apple,no-auto-pm on two states nothing uses.
An approval from someone other than the last pusher (DjDeveloperr) is needed as well, RyanTheTide or erikwb.
Not blocking, for the commit that enables the engine: the PWGATE comment says aux-0 + 0x2b6c, the DAPF record is 0x2c6c.
|
J516s (MacBook Pro 16-inch, M3 Pro, T6030, OS firmware 27.2 / 26B123) boot and
|
satchlj
left a comment
There was a problem hiding this comment.
Reviewed head dcb002b6d136 (non-pusher review):
- Binding (
apple,ane.yaml):apple,t6030-ane/apple,t6031-anecompatibles,ane-type0xc0/0xe0,0x100000b0000DATA IOVA,mboxes: falsesplit withapple,t8122-ane, non-H15 exclusion list, and restored T8132 example all check out cleanly (dt-checksgreen). - DTs (
t6030/t6031/t6032/t8122): All 20 T603x ANE/DART/mailbox nodes arestatus = "disabled"so nothing pins boot power domains; T6030 PMGR adds the four ANE domains verifiedoffat idle and post-s2idleon the J516s row; T8122dma-coherent;matchesmain(53b9adf4e955). - Driver (
drivers/accel/ane/):ane_t6030_platform/ane_t6031_platformstay unqualified (boot_qualified = false), returning-EOPNOTSUPPin preflight before any resource, power, or MMIO access. - CI:
apple-build,dt-checks,host-tests,pr-text,readiness, andKUnit planall pass (KUnit ane-boot ane-pmpending).
|
The device tree should describe the available hardware, with qualification enforced in the driver. The J516s engine-only overlay already exercised that split: |
|
Local run of the
Main has since moved to 35bfbf3. The new commits change only drm/apple DCP files and tools/asahi, which share no files with this PR and are not built into these kernels. The hosted job had not finished when I merged; it started at 15:16Z. |
Replacement for #2331: same change set rebased onto current main, with the
two commits that carried a placeholder author and no Signed-off-by recreated
with the correct author and trailer.
Describes the T603x (M3 Pro/Max) Neural Engine — power domains, DARTs,
mailboxes, preloaded firmware — and keeps the accel/ane driver refusing
T603x cleanly until a platform is qualified. Every ANE node stays
disabled, as on T8122, so no power domain can be pinned by a consumer
that never binds; they enable per board together with driver support.
Closes #2331
Tested: drivers/accel/ane builds W=1 with 0 warnings (clang, arm64); all
seven T603x and five T8122 DTBs build, with T8122 byte-identical to main;
dt_binding_check and CHECK_DTBS clean on apple,ane.yaml.
Risk: T6030, T6031, T6034 and T6032 — two-way, a plain revert undoes it; every ANE
node is disabled and the driver platform is unqualified.