Repository navigation
media: apple: ave: tests: build both host harnesses again and run them in CI - #2697
Conversation
…m in CI tests/run.py and tests/run-recovery.py build the production AVE code against host boundaries, but nothing ran them, and both had stopped building on integration: - run.py copied one firmware text CRC by name, while ave-layout.c now names one per build (T6041 25G83, T6050/T8142 26A428, T6050 26C5035, T8132/T8122 26B123), and it lacked AVE_RC_CQ and GENMASK(). Take every AVE_FW_TEXT_CRC_* and AVE_RC_* define from ave.h, and add GENMASK() to the shim. The harness pastes whole driver files, so clang's -Wunused-function on helpers the tests don't call is turned off. - run-recovery.py imports run.py, which python3 -I does not find; it now puts its own directory on sys.path. It also lacked ave_fw_stop_hung(), which ave_fw_shutdown() calls since b3f30b8 ("media: apple: ave: recover a 6070 encoder after a hung frame"). - strict_6070_recovery still expected the behaviour from before that commit (a broken 6070 firmware refuses runtime suspend). It now checks what the driver does: -EBUSY while a session holds it; with the last session gone the core is stopped and the firmware counts as halted; a core that does not stop stays broken with -EIO; the recovery limit still applies; a recovering firmware still refuses. Both harnesses now run from tools/asahi/run-host-tests.py, so CI's host-tests job builds them on every change. Signed-off-by: Ryan Murray <[email protected]>
|
Merge-train adversarial review (MERGETRAIN-LINUX2) at f90aa74: NO BLOCKERS. Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below. Full review#2697 media: apple: ave: tests: build both host harnesses again and run them in CI @f90aa74bVERDICT: NO BLOCKERS Verified: on base b241e35 both harnesses fail: run.py fails with a cc -Werror build error, and run-recovery.py with Nits
Missing rows
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review at live head f90aa74bd3fd695dfddc54fcd6d503a3a7300248 against the pre-PR checklist: 0 code/policy/attribution/CI blockers. Host-test / CI-only change (zero kernel driver or DT changes), so no hardware rows are required.
Checked & clean
- §1–§2 No model gating / no hacks: Host harnesses and CI wiring only; zero kernel code touched.
- §3 Deep CI & harness correctness:
drivers/media/platform/apple/ave/tests/run.py: wildcard extraction ofAVE_FW_TEXT_CRC_*andAVE_RC_*automatically covers newer firmware CRCs already landed onintegration/aurora(includingAVE_FW_TEXT_CRC_T8142_26B123), andave_fw_check_boot()/ave_fw_check_build()remain compatible with currentintegration/auroraHEAD.-Wno-unused-functionmatchesrun-recovery.pyfor full pasted driver files under Clang-Werror.drivers/media/platform/apple/ave/tests/run-recovery.py: adding the script directory tosys.pathfixesfrom run import ...underpython3 -I, and extractingave_fw_stop_hungsatisfiesave_fw_shutdown().drivers/media/platform/apple/ave/tests/recovery-test.c:strict_6070_recovery()assertions (lines 292–328) accurately match productionave_fw_stop_hung()/ave_fw_shutdown()/ave_fw_runtime_suspend()post-b3f30b8ecdd3(active session →-EBUSY, sticky CTRL →-EIO+ broken, last session gone → CTRL 0 +AVE_FW_HALTED, 3-attempt recovery window limit → 4th-EBUSY,AVE_FW_RECOVERING→-EBUSY), with a verified negative control.tools/asahi/run-host-tests.py: registersave-host(run.py --build {out}) andave-recovery(run-recovery.py) inSUITESinvoked by.github/workflows/host-tests.yml. Verified in the live CI job log (44909440682) that both ran and passed (ok ave-host (5.0s),ok ave-recovery (2.0s)).
- §4 Attribution: Commit
f90aa74bd3fdcarries human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only (zero AI trailers); PR body includesAssisted-by:. - §5 Evidence: GCC 16.1 + Clang 22 ASan/UBSan
-Werrorpasses, negative control confirmed, and livehost-testsCI green onf90aa74b. - §6 Naming: Clean.
Non-blocking nit
drivers/media/platform/apple/ave/tests/shim.h:23:GENMASK(h, l)uses(~0UL >> (63 - (h))), which assumes an LP64 host (sizeof(unsigned long) == 8). Fine on 64-bit Linux hosts/CI, though width-independent orGENMASK_ULL-backed math would be slightly safer.
Assisted-by: LLM (Gemini 4 Neon)
CI compiled only apple-sep.o and the DWC3 object. It ran only sep.kunitconfig and mt7932.kunitconfig. Most Apple drivers and their kunitconfig files had no CI at all. A change that broke them was only found on hardware. The new workflow has two jobs: - apple-build: arm64 defconfig plus asahi.config with LLVM=1 and Rust 1.96.0 (the host-tests pin), with the tree's own bindgen. It checks that every Apple driver is still in .config, so a driver that drops out cannot pass by building nothing. Then it compiles the Apple driver directories and the core files the user4k and KSM work touches. - kunit: one arm64 QEMU run per suite (ANE boot, transport and PM; DCP fabric and topology; asahi; spi-hid; AVD and AVD PM; AVE; ISP; JPEG; ProRes; scaler; macsmc; CLPC; trusted keys). fail-fast is off. sep and mt7932 stay in their own workflows. Two suites had no kunitconfig, so add them: - drivers/mfd/macsmc.kunitconfig runs the macsmc MFD and macsmc-power KUnit tests. - security/keys/trusted-keys/tests/.kunitconfig runs trusted_source, the tests for trust sources registered at runtime. PR aurora-silicon#2697 adds the AVE host harnesses to host-tests. This does not overlap with it. Verified: the YAML parses, and every matrix kunitconfig exists in this tree. Signed-off-by: Alyx-ML <[email protected]>
CI compiled only apple-sep.o and the DWC3 object. It ran only sep.kunitconfig and mt7932.kunitconfig. Most Apple drivers and their kunitconfig files had no CI at all. A change that broke them was only found on hardware. The new workflow has two jobs: - apple-build: arm64 defconfig plus asahi.config with LLVM=1 and Rust 1.96.0 (the host-tests pin), with the tree's own bindgen. It checks that every Apple driver is still in .config, so a driver that drops out cannot pass by building nothing. Then it compiles the Apple driver directories and the core files the user4k and KSM work touches. - kunit: one arm64 QEMU run per suite (ANE boot and PM; DCP fabric and topology; asahi; spi-hid; AVD; AVE; ISP; JPEG; ProRes; scaler; macsmc; CLPC; trusted keys). fail-fast is off. Suites that already have their own workflow are not repeated: sep, mt7932, the Apple display suite (apple-drm-kunit.yml) and pmgr-pwrstate. Two kunitconfigs are left out because another one runs the same suites: ane transport.kunitconfig (boot.kunitconfig also sets UBSAN_SHIFT, and KASAN_INLINE is the default) and avd-pm.kunitconfig (PM_SLEEP is on by default on arm64). push on integration/aurora uses the same paths filter as pull_request, as dt-checks.yml does, so an unrelated merge does not start the jobs. Two suites had no kunitconfig, so add them: - drivers/mfd/macsmc.kunitconfig runs the macsmc MFD and macsmc-power KUnit tests. - security/keys/trusted-keys/tests/.kunitconfig runs trusted_source, the tests for trust sources registered at runtime. PR aurora-silicon#2697 adds the AVE host harnesses to host-tests. This does not overlap with it. Verified: the YAML parses, every matrix kunitconfig exists in this tree, and the push and pull_request paths lists are the same.
CI compiled only apple-sep.o and the DWC3 object. It ran only sep.kunitconfig and mt7932.kunitconfig. Most Apple drivers and their kunitconfig files had no CI at all. A change that broke them was only found on hardware. The new workflow has two jobs: - apple-build: arm64 defconfig plus asahi.config with LLVM=1 and Rust 1.96.0 (the host-tests pin), with the tree's own bindgen. It checks that every Apple driver is still in .config, so a driver that drops out cannot pass by building nothing. Then it compiles the Apple driver directories and the core files the user4k and KSM work touches. - kunit: one arm64 QEMU run per suite (ANE boot and PM; DCP fabric and topology; asahi; spi-hid; AVD; AVE; ISP; JPEG; ProRes; scaler; macsmc; CLPC; trusted keys). fail-fast is off. Suites that already have their own workflow are not repeated: sep, mt7932, the Apple display suite (apple-drm-kunit.yml) and pmgr-pwrstate. Two kunitconfigs are left out because another one runs the same suites: ane transport.kunitconfig (boot.kunitconfig also sets UBSAN_SHIFT, and KASAN_INLINE is the default) and avd-pm.kunitconfig (PM_SLEEP is on by default on arm64). push on integration/aurora uses the same paths filter as pull_request, as dt-checks.yml does, so an unrelated merge does not start the jobs. Two suites had no kunitconfig, so add them: - drivers/mfd/macsmc.kunitconfig runs the macsmc MFD and macsmc-power KUnit tests. - security/keys/trusted-keys/tests/.kunitconfig runs trusted_source, the tests for trust sources registered at runtime. PR aurora-silicon#2697 adds the AVE host harnesses to host-tests. This does not overlap with it. Verified: the YAML parses, every matrix kunitconfig exists in this tree, and the push and pull_request paths lists are the same. Signed-off-by: Alyx-ML <[email protected]>
Problem
drivers/media/platform/apple/ave/tests/run.pyandrun-recovery.pybuild the production AVE encoder code against host boundaries, but nothing runs them, and neither builds on integration/aurora any more.run.pylacks the per-build firmware text CRCs thatave-layout.cnow names, plusAVE_RC_CQandGENMASK(). Underpython3 -I,run-recovery.pycan't importrun.py, and it lacksave_fw_stop_hung(). Once it does build,strict_6070_recoveryfails: it still expects the 6070 behaviour from before b3f30b8 ("recover a 6070 encoder after a hung frame").Change
run.py: copy everyAVE_FW_TEXT_CRC_*andAVE_RC_*define fromave.hinstead of naming them one by one, addGENMASK()to the shim, and turn off-Wunused-function(the harness pastes whole driver files, so clang flags helpers the tests don't call).run-recovery.py: add its own directory tosys.pathand extractave_fw_stop_hung().strict_6070_recoverynow checks the current driver. A session still holds the firmware: -EBUSY, nothing touched. A core that won't stop: -EIO and still broken. Last session gone: the core stops, CTRL reads 0, the firmware counts as halted. The recovery limit still applies, and a recovering firmware still refuses.tools/asahi/run-host-tests.pyruns both harnesses (ave-host,ave-recovery), so the host-tests job keeps them building.No driver code changes.
Testing
run.pyandrun-recovery.pypass with gcc 16.1 and clang 22 (ASan + UBSan,-Werror).ave_fw_shutdown()returning -EBUSY for a broken 6070 again (the pre-b3f30b8e behaviour),strict_6070_recoveryfails.run-host-tests.py --only ave: 8/8. Fullrun-host-tests.py --jobs 8: 448 passed. The 5 failures don't involve AVE: the GCC 16pmp-floor-tests --mutant class-twicecase that tools/asahi: pmp-floor-tests: keep the class-twice mutant building on GCC 16 #2658 fixes, and the two Rust g15 suites (g15-pb-growth,g15-stats-drain, with their mutation runs) hitting the 900 s per-test timeout on a shared build host at load 55.Still to run
Assisted-by: LLM (Claude:Opus 5.5)