Repository navigation
T6021: read-only probe and receipt for the ANE0 AXI2AF bridge tunables - #25
Conversation
ane/t6021/probes/ane_afbridge_probe.c reads the 26 registers that macOS programs on the T6021 ANE0 AXI2AF bridge (base 0x284000000) through a non-posted mapping. It reads only when ane_sys and the seven compute islands are on, waits 3 s, checks the guard again before each read, and logs each address before its read. It never writes.
…t run The macOS 13.5 hv trace writes the 26 bridge tunables at the ANE engine base 0x284000000, so the probe reads that page. ane_t6021 P-1 already writes two of the 26 (eng+0x000, eng+0x400) with the T8103 values, which fail the macOS masks. The receipt gives the PA table, the read risk, the probe build (stock 7.1.13-3-1-ARCH headers), the run procedure and the pass/fail criteria.
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 406b3cc0e7
ℹ️ 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".
| /* ponytail: netconsole is an nbcon kthread and pr_flush() is not | ||
| * exported; 50 ms lets the line leave before the read. */ | ||
| msleep(50); | ||
| pr_crit("%#llx = %#010x\n", pa, readl(afb + afb_off[i])); |
There was a problem hiding this comment.
Pin the power domains across each register read
If auto-gating drops ane_sys or an island during the 50 ms sleep, this readl() executes after the only power check and can access the powered-off engine window; the receipt identifies such an access as capable of hard-resetting the M2. Hold the relevant runtime-PM/genpd reference throughout the scan rather than relying on a check performed before the logging delay.
Useful? React with 👍 / 👎.
| macOS 27.0 (`AppleT6020PMGR::applyBridgeTunables`, the same table in the | ||
| T6020 and T6021 kexts) programs 26 registers on the ANE0 AXI2AF bridge. | ||
| Each is a 32-bit read-modify-write: `reg = (reg & ~mask) | value`. m1n1 |
There was a problem hiding this comment.
Cite the exact source commit for the tunable table
These claims establish the 26-register experiment and its read-modify-write semantics, but they name only a macOS version and symbol, with no exact source/extraction commit for the masks and values. Consequently, the central comparison table cannot be audited or reproduced from the receipt as required for register claims.
AGENTS.md reference: AGENTS.md:L225-L228
Useful? React with 👍 / 👎.
| @@ -0,0 +1,11 @@ | |||
| ifneq ($(KERNELRELEASE),) | |||
There was a problem hiding this comment.
Recreate this commit with the mandated Git identity
The reviewed commit is authored and committed as Codex <codex@openai.com>, whereas this repository requires both identities to be Joshua Warren with 816217+joshuaswarren@users.noreply.github.com; recreate the proposed commit with the required author and committer metadata before landing it.
AGENTS.md reference: AGENTS.md:L250-L257
Useful? React with 👍 / 👎.
| * the 3 s settle wait and again before every read. Each line is logged | ||
| * before its read, so a fault leaves the address as the last line. | ||
| * Output: "ane_afbridge_probe: 0x<PA> = 0x<value>", the input format of | ||
| * af_bridge_compare.py check. Nothing stays mapped after init. |
There was a problem hiding this comment.
WARNING: Dangling reference to a comparison tool that does not exist
The header promises output in "the input format of af_bridge_compare.py check", but no af_bridge_compare.py exists anywhere in the repository (grep -rn af_bridge_compare matches only this line). The receipt's step 5 also describes the comparison as manual, so the documented consumer of this probe's output is missing; either add the checker or drop the claim so a reader does not wait for a tool that will never appear.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| unsigned int i; | ||
| int ret = 0; | ||
|
|
||
| if (!of_machine_is_compatible("apple,t6021")) |
There was a problem hiding this comment.
WARNING: The hard-coded bridge base is never validated against the live DT
AFB_BASE (0x284000000) comes from the macOS kext's ADT reg[38], which the receipt itself records as "still unconfirmed" (README finding 1), and PS_BASE is likewise hard-coded rather than taken from the DT pmgr resource the driver maps with devm_of_iomap(..., 1, ...). The only cross-check is of_machine_is_compatible. If either address is wrong, ioremap_np succeeds and the loop reads arbitrary physical MMIO through a non-posted mapping — the bus-error/hard-reset class the receipt's Risk section is built around. A cheap of_address_to_resource()/of_find_matching_node range check that refuses unless both PAs fall inside the live ane engine and pmgr windows would turn a hard reset into a clean -ENODEV.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
|
|
||
| insmod takes about 4.3 s. | ||
| 4. If the log shows a `refused` line, no engine read happened. Repeat | ||
| step 3 without `flock`, while an encoder process runs. |
There was a problem hiding this comment.
WARNING: Step 4 contradicts the Risk section and re-runs the probe against live ANE work with no exclusion
The Risk section requires running the probe "with no GPU job active" (line 126-127), yet this step deliberately repeats the run while an encoder process is running. The flock in step 3 only serializes probe runs; the module takes no reference to, and no lock with, ane_t6021, so the reads land on engine registers while firmware is live. That contradicts the receipt's own fault classes (an engine read in the wrong power state is what hangs this SoC) and turns a documented SAFE-STOP retry into a materially riskier run. Either state explicitly that the encoder must be idle-but-powered (so ane_sys and the islands are on) with the hard-reset risk re-accepted, or drop the concurrency instruction.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Notes: the 26-offset table was re-verified against Fix these issues in Kilo Cloud Reviewed by free · Input: 0 · Output: 0 · Cached: 0 |
Adds
ane/t6021/probes/ane_afbridge_probe.c, a read-only module that reads the 26 ANE0 AXI2AF bridge registers that macOS programs, and the receiptreceipts/2026-10-01-t6021-af-bridge/README.md.The probe has not run. Running it needs an owner go; the receipt has the procedure and the pass/fail criteria.