Repository navigation
media: apple: ave: demand a DATA alias only where the firmware has one - #3677
Conversation
The M5 Pro and Max encoder (T6050) no longer probes:
apple-ave 2283100000.video-encoder: error -ENODEV: firmware DATA alias
is missing or invalid
Its CPU DART names its address filter ("dapf"), as the binding wants
for the DART's second window, and the driver demands a DATA alias for
every encoder behind a named filter. The alias comes only from the TEXT
link cell, which the T6050 firmware does not have, so it is always zero
there. That firmware reaches TEXT and DATA at their DART addresses, and
the filter its loader programs admits only register windows, so neither
segment is behind it.
Demand the alias, at probe and in the pre-start filter check, only
where the variant has a link cell and the filter or a physical code
base puts the firmware behind the filter. The M1 (T8103), the only
encoder whose firmware is behind its filter, is checked as before; the
other link-cell variants (T6000, T8112) name no filter and are
unaffected. On T6050 the filter is still mapped for the debugfs dump,
which now says the firmware's memory is not behind it.
Fixes: 69ef8fc ("media: apple: ave: require valid DATA alias and filter mapping in guard")
Signed-off-by: Erik Bourget <erik@ebourget.net>
ave_map_darts() visits a DART once per stream the encoder has on it. The T6050 encoder has two streams on its CPU DART, so the second visit finds that DART's filter already mapped and warns: apple-ave 2283100000.video-encoder: /soc@200000000/iommu@22830a0000: a second DART filter; keeping the first Warn only when the window is another DART's. Signed-off-by: Erik Bourget <erik@ebourget.net>
There was a problem hiding this comment.
Verdict: HOLD at 61d3bd2b
Blockers:
- Hosted CI on
61d3bd2bis still queued (apple-build,host-tests,readiness,pr-text, and KUnit suites). Code, KUnit/host test additions, and J716c hardware verification look solid — ready to approve once CI turns green.
Checked:
ave_fw_needs_data_alias()indrivers/media/platform/apple/ave/ave-fw.cgates the DATA alias requirement onave->variant->text_link_cell && (ave->dapf || ave->variant->vcbar_text_phys): preserves unconditional enforcement on T8103 (text_link_cell = 0x423c,vcbar_text_phys = true) anddapf-gated enforcement on T6000/T8112, while clearing M4/M5 variants (text_link_cell == 0,vcbar_text_phys == false) whose nameddapfonly filters register windows.ave_fw_probe(),ave_fw_filter_gap(),ave_fw_check_filter(), andave_dart_dump()handle!ave_fw_needs_data_alias(ave)consistently without misleading filter-admits output.ave_map_dapf()indrivers/media/platform/apple/ave/ave-drv.cdeduplicates repeated visits to the same DART across multiple streams by comparingres.start != ave->dapf_phys, keeping the warning for a distinct second filter or resource lookup failure.- Both commits carry human
Signed-off-by:trailers and include matching KUnit (ave_t6050_cpu_dart_filter) and host recovery test coverage (tests/recovery-test.c,tests/run-recovery.py).
Evidence
- Diff audited: 6 files (
+114/-6), commits7e820a24(Fixes: 69ef8fc5e313) and61d3bd2b. - Hardware verification reported on J716c (M5 Max) at
61d3bd2b:apple-avebinds cleanly without the spurious second-filter warning, 60-frame 720p H.264 encode matches baseline (24.158 dB PSNR), and 30 s deep sleep resumes and encodes cleanly; AVE KUnit 54/54 and host tests pass. - Status checks at review time: 20 queued (
apple-build,host-tests,readiness / readiness,pr-text / pr-text, 16 KUnit suites), 3 skipped.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Approving at 61d3bd2b. The K114s (M5 Pro, 26B8125) shows the same failure on a current main DTB, so this isn't J716c-only.
K114s symptom (bridge10 candidate one-shot, main DTB with #2278 media nodes okay, kernel 7.3.0-k114sstack8 = main AVE sources incl. 69ef8fc): apple-ave 2283100000.video-encoder: /soc/iommu@22830a0000: a second DART filter; keeping the first, then error -ENODEV: firmware DATA alias is missing or invalid. AVD, ProRes, both JPEGs and the ISP bind on the same boot. On 11-29, a kernel without 69ef8fc (plus #3447) encoded H.264/HEVC 120 frames, deterministic 2/2, on this board with the same media nodes.
Checked:
ave_fw_needs_data_alias()= link cell && (named filter || physical code base). T8103 keeps both demands; T6000/T8112 keep them behind a named filter; T6050 (no link cell, DART code base) has none. That matches what 6415f67/69ef8fc5 were guarding: the M1 alias path.- The filter really doesn't cover T6050 firmware. The J873S 27.0 ADT
dart-ave0dapf-instance-0entries are0x23_a3e0_c110-0x23_a3e2_881f,0x62_83e0_c110-…and0x63_a3e0_c110-…: register windows, the same shape as your J716c KUnit fixture, not TEXT/DATA. - The warning change: the K114s DTB has
iommus = <&dart_ave0 0x0 &dart_ave0 0xc &dart_ave0_aux 0x0 &dart_ave0_aux 0xc>. Onlyiommu@22830a0000namesdapf, so the second lookup is the same window and now stays quiet. A genuinely different second filter still warns. - On the K114s, main already admits 26B8125 (#3447), so this alone should make it encode there; the J716c additionally needs #3395.
I'll add a K114s encode row at this head when the next K114s boot with the main media DT comes round (K114S-STACK's bridge10).
|
K114s (Mac17,13, M5 Pro, firmware 26B8125) at
|
|
Regression point for J616s (T6041) and Neo (T8140), checked on main's DTs: neither names |
|
K114s again, this time with |
There was a problem hiding this comment.
Verdict: MERGE at 61d3bd2b16a6
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - ave_fw_needs_data_alias() in drivers/media/platform/apple/ave/ave-fw.c gates the DATA alias requirement on ave->variant->text_link_cell && (ave->dapf || ave->variant->vcbar_text_phys): preserves unconditional enforcement on T8103 (text_link_cell = 0x423c, vcbar_text_phys = true) and dapf-gated enforcement on T6000/T8112, while clearing M4/M5 variants (text_link_cell == 0, vcbar_text_phys == false) whose named dapf only filters register windows.
ave_fw_probe(),ave_fw_filter_gap(),ave_fw_check_filter(), andave_dart_dump()handle!ave_fw_needs_data_alias(ave)consistently without misleading filter-admits output.ave_map_dapf()indrivers/media/platform/apple/ave/ave-drv.cdeduplicates repeated visits to the same DART across multiple streams by comparingres.start != ave->dapf_phys, keeping the warning for a distinct second filter or resource lookup failure.- Both commits carry human
Signed-off-by:trailers and include matching KUnit (ave_t6050_cpu_dart_filter) and host recovery test coverage (tests/recovery-test.c,tests/run-recovery.py).
Follow-ups (not blocking): queued hosted CI
What: The T6050 (M5 Pro/Max) video encoder fails its probe with
firmware DATA alias is missing or invalid. 69ef8fc demands a DATA alias for every encoder whose CPU DART names its filter (dapf), but that alias comes only from the TEXT link cell, which the T6050 firmware doesn't have. This demands the alias only where the variant has a link cell, and drops a false "second DART filter" warning for a DART the encoder lists twice.Tested: J716c M5 Max at
61d3bd2b16a6(same tree as the testedc0a847951bca; only the second commit's message changed), with the two commits merged into the J716c daily candidate, which also carries #3395, the T6050 26B123 firmware admission main still lacks, and #3662, which main needs to boot this board): apple-ave binds and/dev/video*apple-ave appears; a 60-frame 1280x720 H.264 encode decodes 60/60 at the same PSNR as a daily that never had the problem; a 30 s deep sleep resumes and an encode after wake works. AVE KUnit 54/54, AVE host tests pass, checkpatch --strict clean.Risk: two-way door · T6050 encoders (behind a named filter, no link cell) now probe; T8103 is checked exactly as before; T6000/T8112 (link cell, no named filter) and every other variant unchanged
Not yet: on main alone the T6050 encoder still stops at the firmware TEXT CRC until #3395 lands; the encoder DART filter's control bits change across a deep sleep with nothing restoring them (see Details), a separate follow-up
Details
ave0_dart's second windowdapf. That's correct: it is the DART's address filter in the ADT, and the binding requires names once a DART has two windows. On the J716c the ADT'sdart-ave0filter entries cover register windows only, and the T6050 firmware reaches TEXT and DATA at their DART addresses, so neither segment is behind the filter. On the M1 (T8103) the firmware is behind it: TEXT at its physical address and DATA at its alias. Nothing else reads the name: apple-dart only uses adapfwindow on this DART type whenapple,dapf-rangesis present (ave0_darthas none), and the boot loader programs the filter from the ADT.ave_fw_needs_data_alias()decides from the variant: an alias is demanded only when the variant has atext_link_celland either a mapped filter or a physical code base. Probe and the pre-start filter check both use it. Both segments still go through the IOMMU mapping checks at probe and start. On T6050 the filter is still mapped for thedart_auditdebugfs dump, which now says the firmware's memory is not behind it.ave0_dartappears twice in the encoder'siommus(SIDs 0 and 12). The second visit found the same DART's filter already mapped and warned. It now warns only when the window belongs to another DART. Both SIDs stay in the audit mask.0x30instead of0x31, and nothing restores it. Encoding after the wake works, because the firmware's memory isn't behind the filter. Restoring it is separate: the T8110-layout DART driver has no replay data forave0_dart, and addingapple,dapf-rangesalone wouldn't restore the enable bits, because the replay check compares bounds only.Evidence
J716c (T6050) kernel 7.3.0-ewb412+ = the J716c daily candidate
ewb/j716c-daily-412(main87f8dd626a9eplus the open PRs the J716c daily carries, among them #3395 and #3662) with these two commits merged. Boot loader aura main with #585. Command line: default pluswatchdog.open_timeout=120.Without the fix, the same daily logs
apple-ave 2283100000.video-encoder: error -ENODEV: firmware DATA alias is missing or invalidand creates no apple-ave node.AVE KUnit (
drivers/media/platform/apple/ave): 54/54, including the newave_t6050_cpu_dart_filterand the existingave_t8103_cpu_dart_filter. AVE host tests (run-recovery.py,run.py,run-ipc.py,run-input.py) pass with gcc; a T6050 case was added to the recovery test.