Skip to content

accel/ane: cacheable H17 buffers and a short busy-poll for firmware waits - #822

Merged
RyanTheTide merged 3 commits into
aurora-wipfrom
ane/h17-clean
Nov 1, 2026
Merged

RyanTheTide merged 3 commits into
aurora-wipfrom
ane/h17-clean

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-up to #801: per-phase EXECUTE timing for H17, cacheable H17 program buffers, and a short busy-poll window for firmware waits (shared by H16 and H17).

  • 7e112b23 H17 gets the shared per-phase EXECUTE stats in debugfs (ane-h17/<dev>/execute).
  • d207bdf5 H17 program buffers are cacheable, with explicit cache maintenance at LOAD, before each EXECUTE and after the completion report. H16 is unchanged.
  • 7ec07322 Every firmware wait spins in 2 us steps for its first 30 us before the 20-50 us sleeps (H16 and H17).

Hardware:

  • Neo (H17), fleet14g: MobileNetV1 per-image p50 2.82 -> 2.57 (cacheable) -> 2.45 ms (busy-poll); relu 0.37 -> 0.18 ms, add 0.22 ms; all exact, top-1 16/16, no DART faults.
  • J616s (H16) regression check, fleet14h, these modules (boot ed8051c1, in-tree driver blacklisted for that boot): MobileNetV1 top-1 16/16, p50 0.767 -> 0.600 ms; add-128 2 x 16384/16384 exact; no faults or quarantine; gates 9.5/13.9 us (were ~60).

KUnit 168/168, host tests pass, W=1 and checkpatch clean.

🤖 Generated with Claude Code

The shared session has timed every EXECUTE by phase since the H16
latency work, but only the H16 backend printed it, from
<debugfs>/ane-h16/<dev>/execute. The H17 backend uses the same session
and had no way to read it, so a slow MobileNet on the Neo (2.82 ms per
request from userspace against 1.74 ms of firmware time in the research
harness) could not be broken down.

Move the formatter into the program module as
ane_h16_session_stats_show() and use it from both backends. The H17
backend creates <debugfs>/ane-h17/<dev>/execute at the program stage;
writing anything resets the counters, as on H16. The retained backend
pins the module, so the file lives until reboot with its session.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Every program mapping on H17 came from dma_alloc_coherent, which is
uncached memory here: the engine reaches it through the DART without
snooping. The CPU copies the inputs in, poisons the outputs and copies
the outputs out on every EXECUTE, and reading 458752 MobileNet output
bytes from uncached memory took 0.37 ms of a 2.8 ms request on the Neo
(copy_out mean in the per-phase times, 320 runs).

Allocate H17 program mappings with dma_alloc_noncoherent instead and
keep them coherent by hand through a new optional session op, sync:

- at allocation, write the zeroed lines back; at LOAD, after the HWX
  regions and the aux sections are filled, write those back too;
- before each EXECUTE, write back the inputs and the poisoned outputs;
- after the completion report, drop the output lines before copy_out.

The surface carries the backend handle; a surface without one, and a
backend without the op (H16 today), stays coherent and is never synced,
so H16 behaviour is unchanged until its backend opts in.
Firmware-owned memory (pool, IPC, heap, SHAREDMALLOC) stays coherent.

KUnit: LOAD syncs every region and aux section once, the request sync
covers every surface before and only the output after, and coherent
surfaces are never synced.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
With the channel IRQ masked, every reply wait slept at least once:
20-50 us of usleep_range plus timer and wakeup latency. On the Neo the
opening gate, the EXECUTE ack and the closing gate of a MobileNet
request took 106, 190 and 106 us (means over 320 runs, d207bdf), and
a reply usually lands within tens of microseconds.

Poll in 2 us busy steps (udelay) for the first 30 us of a wait, then
sleep 20-50 us as before, backing off to 250 us after 5 ms and to 1 ms
after 50 ms. Both backends pace through the new ane_fw_poll_pause(), so
H16 and H17 share it, and their relax hooks keep servicing the mailbox
and faults on every step. A stalled request costs at most 30 us more
CPU per wait than before.

KUnit: the pacing table, including the busy window.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merge gate: host selftests 158/158 on 7ec0732, KUnit 168/168; hardware on both H16 (J616s) and H17 (Neo) in the description. Merging.

🤖 Generated with Claude Code

@RyanTheTide
RyanTheTide merged commit b2418f4 into aurora-wip Nov 1, 2026
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
…tion/aurora

Bring integration/aurora up to aurora-wip e1524e6, the source of
7.3.0-aurora-fleet14l, promoted on all four machines on 2026-11-02.
The range also covers the fleet14i, fleet14j and fleet14k sources
(a8fa302, d67eece, ce900d1). It adds aurora-silicon#822, aurora-silicon#823, aurora-silicon#824, aurora-silicon#827,
aurora-silicon#829, aurora-silicon#834, aurora-silicon#835, aurora-silicon#836, aurora-silicon#838, aurora-silicon#840 and aurora-silicon#839. No conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide deleted the ane/h17-clean branch November 7, 2026 12:07
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