Skip to content

accel/ane: t8112: set the firmware perf mode at power-on - #1450

Merged
RyanTheTide merged 1 commit into
integration/aurorafrom
ane/t8112-perf-mode-at-power-on
Nov 10, 2026
Merged

RyanTheTide merged 1 commit into
integration/aurorafrom
ane/t8112-perf-mode-at-power-on

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

macOS writes the ANE engine performance-mode property (value 1) once at every firmware power-on. Linux sent it only when fw_perf_mode was written by hand. This sends it on T8112 at probe, right after the CONFIG_GET that arms the transport; firmware restarts already resend it once set.

  • One property-write builder with named offsets, ids and values (ane_t6021_prop_write(), ane_t6021_perf_mode_cmd(), CSNE_CMD_CH_PROPERTY_WRITE), used by power-on, the restart path and the fw_perf_mode parameter; no raw words left at the call sites.
  • A firmware refusal keeps the default mode and the transport; any other error fails the install like a failed CONFIG_GET.
  • perf_mode_at_boot=0 keeps the old behaviour.

Tests: KUnit perf_mode_cmd_test (command layout, header and tail untouched), ane-t6021-lifetime 17/17 under arm64 QEMU; run-host-tests 224/224; checkpatch clean.

M2 (T8112), Linux, one-shot boot with the same config as the current default, 3 interleaved rounds x 1000 runs, p50:

program default perf mode at power-on
1-task depthwise conv 132 / 131 / 130 us 123 / 124 / 122 us
MobileNetV1 ring, ReLU 580 / 582 / 585 us 587 / 580 / 576 us
MobileNetV1 ring, ReLU6 594 / 593 / 593 us 586 / 591 / 576 us

Outputs bit-identical (relative L2 9.5e-5 / 1.5e-3 / 1.5e-3, reference top-5), 0 DART faults, 0 timeouts, 0 AVCs, Enforcing.

🤖 Generated with Claude Code

macOS writes the engine performance-mode property (value 1) once at every
firmware power-on. Linux only sent it when fw_perf_mode was written by
hand, so the M2 ran its calls in the default mode. Set it on T8112 at
probe, right after the CONFIG_GET that arms the transport; restarts
already send it again once it has been set. On the M2 (H14) it lowers
the fixed cost of every call: a one-task program 131 -> 123 us p50
(three rounds of 1000), the fused ReLU6 MobileNet ring 593 -> 584 us,
the ReLU ring within noise, outputs bit-identical.

Build the property write from named offsets, ids and values
(ane_t6021_prop_write(), ane_t6021_perf_mode_cmd(),
CSNE_CMD_CH_PROPERTY_WRITE) and use it for all three senders: power-on,
the restart path and the fw_perf_mode parameter. A firmware refusal
keeps the default mode and the transport; any other error fails the
install like a failed CONFIG_GET. perf_mode_at_boot=0 keeps the old
behaviour. KUnit checks the command layout.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 10, 2026 10:58
@RyanTheTide
RyanTheTide merged commit 91d1d7c into integration/aurora Nov 10, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the ane/t8112-perf-mode-at-power-on branch November 10, 2026 10:58
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