Repository navigation
apple: remove exported functions with no caller (-145) - #2369
Conversation
apple_dart_m5_restore() came in with the T6050 suspend-to-RAM work (5ce3491) without a caller, and nothing has called it since. The firmware 27 display sleep restores its DARTs through the v27 lease (apple-dart-v27-late.inc). Nothing ever writes the fields the function restores (m5_streams, m5_gapf, m5_diag, m5_error_mask, m5_protect, m5_lock), and m5_changed is only ever cleared, so even with a caller it would have restored zeros. Remove the function, its declaration and stub, and the fields only it used. m5_sleep_owner, m5_disp_streams and m5_display stay; the v27 code uses them. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The dwc3 glue finishes a sleep with apple_atcphy_sleep_finish_async() and polls apple_atcphy_sleep_finish_done() since a667121 ("usb: dwc3: apple: keep USB teardown out of the PM notifier chain"). That removed the last caller of apple_atcphy_sleep_finish() and apple_atcphy_sleep_finish_flush(). Remove both exports and their stubs. The static atcphy_sleep_finish() stays; the finish work runs it. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
macsmc registers its sleep notices through apple_sleep_smc_register_saved(), which takes the full ops table. Nothing calls the older apple_sleep_smc_register(), which only took the late notice and refused to run once saved ops were registered. Remove it and its stub. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
No driver frees a devm RTKit instance early: nothing in the tree, C or Rust, calls devm_apple_rtkit_free(). Remove it. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
apple_pmp_j713_gpu_check() was added beside the GPU prepare and get helpers but has never had a caller. Remove it; pmp_power_check() keeps its display callers. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
isp_firmware_boot_stage1() carries an #if 0 block that reset the coprocessor only when a GPIO word read back a marker, disabled because it did not work well with system sleep. The unconditional isp_reset_coproc() right after it replaced it. Drop the block and the commented-out variable it needed. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
No blockers. All six removed exports and the nine Assisted-by: LLM (Claude:Opus 5.5) |
|
One problem found by checking open PRs against this removal; everything else holds at the current integration/aurora (the branch still merges cleanly and every removed symbol has no reference left in the merged tree).
The other four removals ( Assisted-by: LLM (Claude:Opus 5.5) |
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at verified live head 5996b85e1212f26c581e95b7f1a7cf16bbcefd3e against live integration/aurora (70a00e583b03, not superseded).
Verified Clean
- Caller & dead-helper audit on live
integration/aurora(70a00e583b03): All six removed exports (apple_dart_m5_restoreplus its 9 unread/unwrittenm5_*fields instruct apple_dart,apple_atcphy_sleep_finish,apple_atcphy_sleep_finish_flush,apple_sleep_smc_register,devm_apple_rtkit_free,apple_pmp_j713_gpu_check) and the#if 0block indrivers/media/platform/apple/isp/isp-fw.chave zero callers on liveintegration/aurora. All retained helpers (apple_dart_state_retained,apple_dart_m5_streams_unownedinapple-dart-v27-late.inc:384,apple_rtkit_free_wrapper,pmp_power_check,s->smc.late_notice) keep active callers. - Attribution (§4): All 6 commits carry human author/committer and human
Signed-off-by:only (zero AI commit trailers); PR body discloses assistance.
Blockers Before APPROVE
- Unresolved silent build breakage with open PR #2215 (
7e229ab510a7, non-draft):- Verified on live #2215: it adds
static inlinewrappersapple_typec_phy_sleep_finish()andapple_typec_phy_sleep_finish_flush()toinclude/linux/phy/apple-atc.hcallingapple_atcphy_sleep_finish()andapple_atcphy_sleep_finish_flush(). - Because the edits land in non-overlapping regions of
include/linux/phy/apple-atc.h, a 3-way merge of #2369 and #2215 produces no textual conflict and fails to compile every translation unit that includes<linux/phy/apple-atc.h>. - Please either drop commit
6090c7283e84(phy: apple: atc: remove the synchronous sleep finish and its flush) from #2369 or update #2215 to remove those unused wrappers first.
- Verified on live #2215: it adds
- §6 Stale base / missing live CI coverage:
- Head
5996b85e1212is still based on0abc2f385e54(2026-11-19). Liveintegration/auroraadded.github/workflows/pmgr-pwrstate-kunit.ymlon2026-11-23(triggered byinclude/linux/soc/apple/**, which this PR modifies), and it has not run on this head. - Please rebase/merge onto live
integration/aurora(70a00e583b03) sopmgr-pwrstate-kunit,sep-source, andhost-testsall run green against the current tree.
- Head
Non-Blocking Note
include/linux/soc/apple/sleep.hlines 40–46 are adjacent to PR #2384's edits; keep merge-train ordering in mind once both are ready.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 5996b85e1212
Blockers:
include/linux/phy/apple-atc.h: commit6090c728removesapple_atcphy_sleep_finish()andapple_atcphy_sleep_finish_flush(), but open #2215 (T6040 suspend-to-RAM) addsstatic inlinewrappers in the same header that call them. The edits don't overlap, so the two PRs merge without a text conflict, and then every file that includes<linux/phy/apple-atc.h>fails to build. Fix: drop6090c728from this PR (it can go once #2215 settles), or remove the wrappers from #2215 first.
Checked: no Apple material, no runtime change beyond removing exported functions that have no caller. The fleet build of all eleven deadweight branches has no undefined symbols, and the W=1 single-object builds of the callers are clean. CI green. This replaces my earlier review. The stale base isn't a blocker; GitHub reports the PR mergeable.
Evidence
Read the diff (-145) and checked #2215 at 5467f0f9 for the two functions.
Superseded by the review at 5996b85
…flush" This reverts commit 6090c72. Review follow-up: open #2215 (T6040 suspend-to-RAM) still calls apple_atcphy_sleep_finish() and apple_atcphy_sleep_finish_flush(). The two PRs do not conflict in text, so landing both would break every file that includes <linux/phy/apple-atc.h>. Keep the two exports until #2215 has settled; their removal can follow it. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
# Conflicts: # drivers/soc/apple/sleep.c # include/linux/soc/apple/sleep.h
|
Fixed at df87001 (normal push: a revert plus a merge of Blocker 1 ( |
There was a problem hiding this comment.
Verdict: FINISH, then merge at df870017
Blockers:
- Branch is
CONFLICTING(DIRTY) withmain; forward-mergemain(no force push) and re-run CI to green. - Missing exact-head boot smoke row after resolving the conflict.
Checked:
- Prior blocker resolved:
ac05cfaccleanly reverts6090c728, keepingapple_atcphy_sleep_finish()andapple_atcphy_sleep_finish_flush()intact while#2215is open; the remaining removals drop genuinely uncalled exported helpers across Apple drivers (+1/-116), and 27/27 CI checks passed beforemainmoved. - Checked for Apple material, tool attribution, private serials, and gating: clean.
Evidence
- Head:
df87001778e0(base: main,mergeable: CONFLICTING,+1/-116across 9 files).
Keep main’s error-returning apple_dart_power_dark declaration while removing the unused apple_dart_m5_restore declaration. Signed-off-by: DjDeveloperr <hey@djdev.me>
There was a problem hiding this comment.
The forward merge resolves the main conflict and the PR diff leaves the ATC PHY header and exports intact. The previous build receipt predates this head. Keep the current build and host checks pending and post an exact-head boot smoke result before landing the cleanup.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Merged main into 50ed245. The ATC sleep exports used by #2215 remain, as does the error-returning apple_dart_power_dark declaration. The four removed exports have no remaining callers on the merged source. All five changed arm64 driver objects compiled. This resolves my earlier code finding. Because I pushed this merge, another eligible reviewer must approve the last push.
There was a problem hiding this comment.
Verdict: MERGE at 50ed245d202d
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: Code reviewed in the earlier App review at this head (6122195489).
Follow-ups (not blocking): Reviewer withdrew boot-smoke ask; build/host checks suffice
Problem
Several exported functions in our Apple drivers have no caller anywhere in the tree (C or Rust). Most are the first version of an interface that a second version replaced. There is also one
#if 0block.Change
Six commits, one per subsystem, net -145 lines, no functional change:
apple_dart_m5_restore()and the fields only it read. It came in with the T6050 S2R work (5ce3491) without a caller; the v27 lease replaced it. Nothing ever wrote those fields, so it would have restored zeros.apple_atcphy_sleep_finish()and_finish_flush(). dwc3-apple uses only_finish_async()/_finish_done()since a667121.apple_sleep_smc_register(). macsmc usesapple_sleep_smc_register_saved().devm_apple_rtkit_free(), which has no user.apple_pmp_j713_gpu_check(), which has had no user since it was added (1ae4d49).#if 0conditional coprocessor reset. The unconditionalisp_reset_coproc()after it replaced it.Not included:
typec_mux_prepare()has no in-kernel caller, but the host testtools/testing/selftests/drivers/gpu/apple-dcp/quiesce.pyexercises it.Testing
make Image modules dtbsRC=0, 5,909 modules, modpost reports no undefined symbols, and the only warnings are ones the baseline already had in untouched files.make prepare+W=1single-object builds before and after: apple-dart.o, atc.o, sleep.o, rtkit.o, pmp-display.o, isp-fw.o and dcp.o, plus the callers macsmc.o and dwc3-apple.o. RC=0, no new warnings.git grep -n -w <symbol>on 0abc2f3 finds only each function's definition, its export, its header prototype and its stub.Still to run
Nothing build-side.
Caller grep per symbol