Repository navigation
media: apple: ave: run command KUnit suites with the module - #2974
Merged
Merged
Conversation
Link the ABI, MCTF and CMP420 suites with apple-ave so KUnit can run them when the encoder is built as a module. Keep the test option unavailable when a built-in encoder would call into modular KUnit. Use the driver metadata for the linked suites and describe the separate recovery test module. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide
commented
Nov 23, 2026
RyanTheTide
left a comment
Contributor
Author
There was a problem hiding this comment.
Review at f793bc2. No source blockers. Linking the suites to the driver resolves the module-only symbol problem, and the explicit Kconfig condition rules out built-in AVE with modular KUnit. No test is linked when the KUnit option is off. The 47/47 built-in and 47/47 module results include the M2 refusal cases. Keep the new composite-object entries when reconciling the overlapping Makefile hunk in #2902.
DjDeveloperr
approved these changes
Nov 23, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist audit at live head f793bc2dd546cdbb3b4c993aa8462ada0cb50d14.
Technical Audit (=m vs =y, Kconfig, Kbuild, KUnit)
- Kconfig (
drivers/media/platform/apple/ave/Kconfig):VIDEO_APPLE_AVE_CMD_KUNIT_TESTremainsboolwithdepends on VIDEO_APPLE_AVE && KUNITanddepends on KUNIT=y || VIDEO_APPLE_AVE=m. All matrix combinations behave cleanly:(y, y),(m, y), and(m, m)are permitted;(y, m)is properly excluded so a built-inapple-avecannot reference modular KUnit symbols; when disabled, zero test objects are linked intoapple-ave. - Makefile (
drivers/media/platform/apple/ave/Makefile):apple-ave-$(CONFIG_VIDEO_APPLE_AVE_CMD_KUNIT_TEST) += ave-abi-test.o ave-mctf-test.o ave-cmp420-test.oappends toapple-ave-ywhen enabled, which Kbuild links into theapple-avecomposite object for both=yand=m, giving the command suites direct visibility to internal AVE symbols without addingEXPORT_SYMBOL*exports. - Module metadata & KUnit section layout:
kunit_test_suite()places unique static pointers in.kunit_test_suites, so linking all three suites intoapple-ave.koalongsidemodule_platform_driver(ave_driver)is safe. Removing duplicate#include <linux/module.h>/MODULE_LICENSE/MODULE_DESCRIPTIONfrom the three linked test files delegates cleanly toave-drv.c(MODULE_DESCRIPTION,MODULE_LICENSE("GPL"),MODULE_IMPORT_NS("DMA_BUF")). AddingMODULE_DESCRIPTIONto standaloneave-recovery-test.cresolves themodpostwarning underVIDEO_APPLE_AVE_KUNIT_TEST=m(matchingave-sizes-test.c). - Symbol hygiene & teardown: All helpers/cases in the three linked test files are
static(no collisions withapple-ave-y), and dynamic allocations usekunit_kmalloc/kunit_kzallocorkunit_add_action_or_reset(..., t_free, p).
Checklist (§1–§6) & CI
- §1 No model gating: Pass.
- §2 Production-ready, no hacks: Pass — zero runtime/cmdline changes; zero test code linked when
VIDEO_APPLE_AVE_CMD_KUNIT_TEST=n. - §3 Safety: Pass.
- §4 Clean-room & attribution: Pass — commit
f793bc2dd546carries human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, with zero AI trailers in commits; PR body disclosesAssisted-by: LLM (Codex). - §5 Evidence: Pass — KUnit build/packaging change with synthetic inputs and no hardware/firmware path modified; verified 47/47 cases in arm64 QEMU both built-in and as loaded modules on fleet85 (
W=1clean,(y, m)exclusion verified), plus host AVE suites (ave-host,ave-recovery,ave-input,ave-ipc,ave-pm-tests,ave-probe-pm-tests). - §6 Naming: Pass.
- Live CI (
f793bc2dd546): 7/7 checksCOMPLETED / SUCCESS(host-tests,source,rust-build,kunit,DWC3/ATC builtin-no-atc,DWC3/ATC modular-no-atc,DWC3/ATC builtin-modular-atc). Note that CIkunitcurrently runsapple_sep*only; AVE KUnit execution was verified locally in arm64 QEMU.
Assisted-by: LLM (Gemini 4 Neon)
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.
Problem
The AVE firmware ABI, MCTF and CMP420 KUnit suites require a built-in encoder. Fleet kernels build AVE as a module, so loading the encoder cannot exercise those suites, including the M2 firmware refusal checks from #2963.
Change
Link the three suites into
apple-aveso the same tests run in both configurations. Keep the option unavailable when a built-in driver would depend on modular KUnit. Use the driver's module metadata for the linked suites and add a description to the standalone recovery test module.Testing
Arm64 QEMU passed 47/47 AVE cases with the encoder built in and 47/47 after loading the test-enabled modules on the fleet85 kernel. The host ABI, recovery, input and IPC suites passed. Strict checkpatch reported zero errors, warnings or checks.
Configuration and per-suite results
VIDEO_APPLE_AVE=mandKUNIT=m. The driver and both standalone test modules linked withW=1and had descriptions. Kconfig kept the command suites disabled withVIDEO_APPLE_AVE=yandKUNIT=m.Assisted-by: LLM (Codex)