Skip to content

accel/ane: t6021: bind quietly when firmware is absent for sync_state - #3606

Merged
DjDeveloperr merged 1 commit into
mainfrom
fix/ane-t6021-missing-fw-bind
Dec 1, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
fix/ane-t6021-missing-fw-bind

Conversation

@maralcbr

@maralcbr maralcbr commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What: When ANE firmware has not yet been installed, ane_t6021_fwload_check() already logs an info message and returns -ENODEV without touching hardware. Return 0 from ane_rtclient_probe_inner() with drvdata == NULL (and guard NULL drvdata in sleep PM, remove(), and sysfs is_visible()) instead of failing probe with dev_err_probe(). This eliminates the spurious error -ENODEV: firmware preflight failed boot error and allows the seven apple-pmgr-pwrstate suppliers to reach sync_state() instead of remaining stuck in sync_state() pending due to 284000000.ane forever.

Tested: J416 (MacBook Pro 16" M2 Max, 284000000.ane) on 7.3 carry build 7.3.0-lab3ceda392-11ed (lab jobs j1129-174818-e436 and j1129-175551-7b35, b1129-174341-04de, clang 19.1.7 + lld):

  • Before (7.3.0-1-1-ARCH): ane_t6021 284000000.ane: error -ENODEV: firmware preflight failed, 7 apple-pmgr-pwrstate domains stuck in sync_state() pending due to 284000000.ane, omarchy-m-test failed hardware.drivers:apple,t6021-ane.
  • After (7.3.0-lab3ceda392-11ed): zero firmware preflight failed errors, info notice preserved (firmware apple/ane/t602x_ane0_fw_selene_rc4x.macho is not installed, so the ANE stays off), 284000000.ane bound to ane_t6021, /dev/accel absent, ane_stats/wedged/reset sysfs attributes hidden, zero sync_state() pending messages, all ANE PMGR domains state_synced=1.
  • boot-health pass (0 failed units, 0 kernel errors on clean boot j1129-174818-e436), omarchy-m-test 0.2.0 pass (hardware.drivers:apple,t6021-ane fixed, 0 regressions); checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.

Risk: two-way door · affects only H14 (t6020/t6021/t6022/t8112) systems without installed ANE firmware; /dev/accel remains absent and no ANE hardware or power domain is touched. H16/H17 and systems with firmware installed follow the existing path unchanged.

When the Apple Neural Engine firmware blob has not yet been installed,
ane_t6021_fwload_check() logs an informational notice and returns
-ENODEV. ane_rtclient_probe_inner() currently passes that -ENODEV to
dev_err_probe() and fails probe(), which emits a spurious KERN_ERR boot
message ("error -ENODEV: firmware preflight failed") and leaves the
platform device unbound.

Because the unbound device remains an unsatisfied fw_devlink consumer of
its seven apple-pmgr-pwrstate power-domain suppliers, those domains stay
stuck in "sync_state() pending due to 284000000.ane" indefinitely and
keep boot-on domains pinned on.

Return 0 from ane_rtclient_probe_inner() with drvdata left NULL when
ane_t6021_fwload_check() reports -ENODEV, without touching hardware or
registering /dev/accel, and guard NULL drvdata in the sleep PM, remove,
and sysfs visibility callbacks.

Signed-off-by: Marcelo Alcantara <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 4551c626

Blockers: none (await queued CI completion before merge).

Checked:

  • Audited drivers/accel/ane/ane_t6021_rtclient_main.c (+16/-1) and drivers/accel/ane/ane_t6021_fwload.c (ane_t6021_fwload_check()).
  • ane_t6021_fwload_check() returns -ENODEV exclusively on -ENOENT from firmware_request_nowarn() after logging its informational notice and before touching hardware or power domains; all other load/validation failures still return non--ENODEV errors to dev_err_probe().
  • Returning 0 with drvdata == NULL binds the platform device so fw_devlink allows the apple-pmgr-pwrstate suppliers to reach sync_state(), while leaving ane_rtclient_active == NULL, registering no /dev/accel node, and guarding NULL drvdata across all driver callbacks (ane_rtclient_sleep_pm_suspend, ane_rtclient_sleep_pm_resume, ane_rtclient_remove, and ane_t6021_stats_is_visible, which hides all three sysfs attributes ane_stats, wedged, and reset).
  • J416 (M2 Max, 284000000.ane) hardware verification confirms zero firmware preflight failed errors, info notice preserved, /dev/accel absent, sysfs attributes hidden, and all ANE PMGR domains reaching state_synced=1, with boot-health and omarchy-m-test passing.
  • DCO Signed-off-by: present; no Apple material or policy issues.
Evidence
  • Diff: drivers/accel/ane/ane_t6021_rtclient_main.c (+16/-1).
  • Audited all dev_get_drvdata/platform_get_drvdata users and ane_rtclient_driver ops (.probe, .remove, .pm, .dev_groups; no .shutdown or runtime PM callbacks).
  • CI at review time: 20 queued, 1 pending, 3 skipped (0 failures).

maralcbr added a commit to omacom/linux-aurora that referenced this pull request Nov 29, 2026
Carry four Omarchy 4.6 RC kernel fixes for J416 / Apple Silicon 7.3 until
upstream merges and retires them:
- aurora-silicon/linux#3605 (222e0e6): downgrade repeated ACIO Phase 3
  AT register read timeout RTKit syslogs to dev_dbg()
- aurora-silicon/linux#3606 (4551c62): bind ane_t6021 quietly when
  firmware is absent so the 7 PMGR domains reach sync_state()
- aurora-silicon/linux#3607 (40936f1, runtime commits 21bf1ba and
  aa3002f): fix BCM4388 codecs_v2 SoA layout and -EINVAL SCO caps
- aurora-silicon/linux#3608 (8783076): honor fault_log_ratelimit() in
  asahi mark_pending_events()

All five carried commits cherry-pick cleanly onto carry/aurora-7.3
(3058cc5) with zero conflicts and passed hardware verification on
m2-max (lab build b1129-174341-04de, jobs j1129-174818-e436 and
j1129-175551-7b35).

Signed-off-by: Marcelo Alcantara <[email protected]>
@github-actions github-actions Bot added area:media Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Merge readiness at 4551c626: not ready yet

Check Detail
CI at head no failing: KUnit asahi, KUnit spi-hid-apple, KUnit avd, KUnit ave, KUnit isp, KUnit jpeg
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 4551c626
Conflicts ok not computed yet
PR text ok Risk: two-way · affects only H14 (t6020/t6021/t6022/t8112) systems without installed ANE firmware; /dev/accel remains absent and no ANE hardware or power domain is touched. H16/H17 and systems with firmware installed follow the existing path unchanged.

Areas: area:media

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the paths that read drvdata. Probe returns before platform_set_drvdata(), so it stays NULL. Runtime PM isn't enabled yet on that path. The stats group hides every attribute, and sleep PM and remove are guarded. Thanks.

@maralcbr

maralcbr commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

J416c (16-inch M2 Max, T6021) at 4551c626: boots cleanly with ANE firmware absent; 284000000.ane binds quietly to ane_t6021 with zero firmware preflight failed errors, /dev/accel absent, ANE sysfs attributes hidden, and all 7 apple-pmgr-pwrstate domains state_synced=1 (boot-health and omarchy-m-test pass).

Evidence

Batched carry kernel 7.3.0-lab3ceda392-11ed (lab build b1129-174341-04de, clang 19.1.7 + lld; tree 2298fdf4d88289e9f5bcaf172ae0129e4afb21d6, byte-identical to omacom/linux-aurora tag aurora-7.3.0-2 / c27570ea2936 built as 7.3.0-2-1-ARCH) carrying 4551c62631fc cherry-picked unchanged alongside #3605 (222e0e6b), #3607 runtime commits (21bf1ba0, aa3002fe), and #3608 (87830763).

  • Clean boot (j1129-174818-e436): booted in 29 s; boot-health PASS (0 failed units, 0 kernel errors); omarchy-m-test 0.2.0 PASS (hardware.drivers:apple,t6021-ane fixed, 0 regressions).
  • Targeted check (j1129-175551-7b35): ane_err=0, ane_info=1 (firmware apple/ane/t602x_ane0_fw_selene_rc4x.macho is not installed, so the ANE stays off), sync_pend=0, 284000000.ane bound to ane_t6021, /dev/accel absent, ane_stats/wedged/reset sysfs attributes hidden, all ANE PMGR domains state_synced=1.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@DjDeveloperr
DjDeveloperr merged commit fbdd1fb into main Dec 1, 2026
31 of 47 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/ane-t6021-missing-fw-bind branch December 1, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:media Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants