Repository navigation
iommu/apple-dart, drm/asahi, soc: apple: sparse and kernel-doc fixes - #2830
Conversation
max(FIELD_GET(...READ_PORTS, params), FIELD_GET(...WRITE_PORTS, params)) expands past sparse's token limit, so sparse reports "too long token expansion" and stops checking the rest of the expression. Read the two port counts into locals first and take max() of those. No functional change. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
dma_fence::ops is __rcu. asahi_g17_is_scope() compared it directly, which sparse reports as a comparison between different address spaces. Use rcu_access_pointer(), as dma_fence_is_array() and the g18 sync_input code do. No functional change. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
W=1 kernel-doc reports the struct member as undocumented. Describe it: the PMC floor voter agent of the PMP that apple_clpc_gpu_limited() reads when @pmp_backoff is set. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review at c0e1ac8.
Looks good. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial pre-PR checklist (§1–§6) review at c0e1ac84782a45e74ab5ab5ff94264dd84cf635e:
- Technical / semantics check:
iommu/apple-dart(a6615613): splittingmax(FIELD_GET(...READ_PORTS...), FIELD_GET(...WRITE_PORTS...))intounsigned int rports/wportsacross all 4 sites (apple-dart-cio-power.h:30-32,apple-dart-sleep.c:367-369,apple-dart.c:7291-7293,apple-dart.c:7872-7874) preserves exact 3-bit unsigned extraction (GENMASK(18, 16)/GENMASK(22, 20)), singlereadl(), and the!ports || ports > 4bounds check with no truncation or signedness change. Nomax(FIELD_GETsites remain indrivers/iommu/apple-dart*.drm/asahi/g17/sync_scope.c(7ce3f99f):dma_fence::opsisconst struct dma_fence_ops __rcu *(include/linux/dma-fence.h:75). Usingrcu_access_pointer(fence->ops) == &scope_opsmatches upstreamdma_fence_is_array()/dma_fence_is_chain()(dma-fence.h:772,783) and is strictly safer (addsREAD_ONCE()without dereferencing). No other rawfence->opsreads exist insync_scope.c.soc/apple/clpc.c(c0e1ac84):@pmp_agentaccurately documents its sole use (apple_pmc_floor_read(clpc->pmc, clpc->hw->pmp_agent)at line 706 whenpmp_backoffis set), and all 18 members ofstruct apple_clpc_hware now documented.
- §1 No model gating / §2 Production-ready / §3 Safety: Pass — no model gates, no hacks, no safety limits weakened.
- §4 Clean-room & attribution: Pass — all 3 commits carry human author/committer (
Ryan Murray <ryan@aurorasilicon.org>), humanSigned-off-by, zero AI trailers in commits, andAssisted-by:in the PR body. - §5 Evidence: Pass — W=1 C=2 clean, objdump verified,
checkpatch --strictclean, all 7/7 CI checks green (host-tests,source,rust-build,kunit, and all 3 DWC3/ATC build variants), mergeable (clean). - §6 Naming: Pass.
Verdict: APPROVE — ready for MERGETRAIN-LINUX4.
Assisted-by: LLM (Gemini 4 Neon)
|
Merge-train adversarial review (MERGETRAIN-LINUX4) at c0e1ac8: no blockers. Merges clean on integration/aurora, alone and together with #2828-#2832. Full reviewVERDICT: NO BLOCKERS Blockers: none. Checked:
Nits: none. Assisted-by: LLM (Claude:Opus 5.5) |
|
Post-merge check at cdce3146 (#2828-#2831 merged onto integration/aurora 120d6aa, fleet79 config, LLVM arm64). In apple-dart.o the four max() sites now compare the port counts in 32-bit registers; values and the range checks are the same (3-bit fields). The only other difference there is the KUnit LINE constants in apple_dart_fw_leaf_test. rcu_access_pointer() is the right accessor in sync_scope: fence->ops is __rcu and the pointer is only compared, as dma_fence_is_chain() does; the object gains one re-read of fence->ops in asahi_g17_scope_create, which is harmless. clpc.o is identical. sparse goes from 9 errors to 0 across dart and sync_scope, and kernel-doc on clpc.c is clean (2 -> 0). |
Problem
A W=1 + sparse build of the integration/aurora tip reports:
iommu/apple-dart: "too long token expansion" at the four places that takemax(FIELD_GET(..READ_PORTS..), FIELD_GET(..WRITE_PORTS..)). sparse stops checking those expressions.drm/asahi/g17/sync_scope.c: comparing the__rcudma_fence::opspointer directly (different address spaces).soc/apple/clpc.c: kernel-doc reportsapple_clpc_hw.pmp_agentas undocumented.Change
max().rcu_access_pointer(fence->ops), asdma_fence_is_array()and the g18sync_input.cdo.pmp_agent.No functional change.
Testing
drivers/iommu/,clpc.oandsync_scope.owith the fleet79 config: no warnings left from these files.clpc.ois identical. Inapple-dart.oonly instruction order and register width around the twoubfxchanged; thereadl()barrier and its fake dependency are still there. Insync_scope.othere is one extra-instruction difference from theREAD_ONCE()inrcu_access_pointer().Tracking issue: #2827
Still to run
Nothing hardware-specific. The apple-dart KUnit suite would be a cheap extra check.
Details
Logs (lab store):
traces/ci/20261123-code-health/logs/w1-sparse.log(before),soc-iommu-after.log(after).Assisted-by: LLM (Claude:Opus 5.5)