Repository navigation
drm/apple: afk: match named compact services before the wildcard - #2757
Merged
niteria merged 1 commit intoNov 22, 2026
Merged
Conversation
Contributor
|
The matching change looks right to me.
Assisted-by: LLM (Claude:Opus 5.5) |
In afk_compact_match_service(), the first pass returned a "*" entry as soon as it met one. That caused two surprises whenever an endpoint's table included a wildcard: - A compact announcement that filled its field arrives without the end of its name and is only checked against compact_full in the second pass, so "*" caught it before the cut-name pass ever ran. - A "*" listed ahead of a named entry also shadowed that entry's exact matches in the first pass. Record the first "*" entry and return it only as a last resort after both the exact-name pass and the cut-name pass fail, so named entries always win regardless of table order. Signed-off-by: Bartosz Nitka <[email protected]>
niteria
force-pushed
the
afk-cut-before-wildcard
branch
from
November 22, 2026 03:16
f20b4d1 to
86a842b
Compare
Contributor
Author
|
Addressed both points in
Re-verified on Assisted-by: LLM (Google:Gemini 4 Neon) |
DjDeveloperr
approved these changes
Nov 22, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Adversarial review at 86a842b98e42 against the pre-PR checklist.
Verified
- §1–§3 (Code correctness & edge cases):
afk_compact_match_service()records the first"*"entry (any = any ?: ops) and returns it only after both pass 1 (exact named match) and pass 2 (afk_compact_cut_of()) fail. Verified thatafk_compact_cut_of()requiresops->compact_full(so"*"is safely ignored in pass 2), that short/uncut announcements returnany, and that none of the in-tree wildcard tables (dcp_compact_aux_ops,dcp_ext_av_service_ops,dcp_m4_probe_ops) combine"*"withcompact_fullor place"*"ahead of a named entry — so this commit changes no current in-tree lookup while fixing the matcher contract cleanly. The KUnit testafk_compact_cut_before_wildcard_testcovers both"*"-last and"*"-first tables across exact, cut, and fallback cases. - §4 (Clean-room & attribution): Clean. Human author/committer (
Bartosz Nitka) +Signed-off-by:only, zero AI trailers in commit,Assisted-by:present in PR body. - §5 (Verification evidence): Complete for a pure matcher contract fix with zero in-tree runtime behavior change (
checkpatch.pl --strictclean,W=1arm64 build clean, arm64 QEMU KUnitapple-epic-parser10/10 passing,apple-dcphost tests 92/92, GitHub CIhost-testsgreen on86a842b98e42). - §6 (Naming): Clean.
0 code, policy, attribution, or CI blockers.
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
afk_compact_match_service()matches a compact service announcement in two passes: exact names first, then truncated 31-byte names viaafk_compact_cut_of(). Because pass 1 returned immediately upon seeingops->name == "*":"*"beforeafk_compact_cut_of()ever ran."*"was also shadowed by"*"in pass 1.At this head no in-tree table combines
"*"with acompact_fullentry or places"*"before a named entry, so this commit changes no current in-tree lookup on its own; it fixes the matcher contract for any endpoint table that mixes named/cut entries with a wildcard fallback.Change
drivers/gpu/drm/apple/afk.c: record the first"*"entry during pass 1 (any = any ?: ops) and return it only as a last resort after both the exact-name pass and the cut-name pass fail, so named entries always win regardless of table order.drivers/gpu/drm/apple/afk-parser-test.c: addafk_compact_cut_before_wildcard_testcovering both a wildcard-last table and a wildcard-first table (exact named matches, truncatedcompact_fullmatches, and cut/uncut unknown fallbacks to"*").Testing
scripts/checkpatch.pl --strict --git HEAD~1..HEAD(head86a842b98e42): 0 errors, 0 warnings, 0 checks.W=1arm64 cross-compile ofdrivers/gpu/drm/apple/afk.o: 0 warnings.CONFIG_DRM_APPLE_PARSER_KUNIT_TEST=y, suiteapple-epic-parser): 10/10 passed, including the expandedafk_compact_cut_before_wildcard_test("*"-last and"*"-first tables).tools/asahi/run-host-tests.py: 451/452 passed (includingapple-dcp92/92; the 1 failure is pre-existingpmp-floor-tests.py --mutant class-twicehitting-Werror=unused-but-set-variableongov.h:49under both GCC and Clang).Assisted-by: LLM (Google:Gemini 4 Neon)