Repository navigation
accel/ane: cacheable H17 buffers and a short busy-poll for firmware waits - #822
Merged
Merged
Conversation
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>
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 |
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>
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.
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).
7e112b23H17 gets the shared per-phase EXECUTE stats in debugfs (ane-h17/<dev>/execute).d207bdf5H17 program buffers are cacheable, with explicit cache maintenance at LOAD, before each EXECUTE and after the completion report. H16 is unchanged.7ec07322Every firmware wait spins in 2 us steps for its first 30 us before the 20-50 us sleeps (H16 and H17).Hardware:
KUnit 168/168, host tests pass, W=1 and checkpatch clean.
🤖 Generated with Claude Code