Skip to content

pmdomain: apple: run the PMC and PMP report without a PMP the boot loader did not hand over - #3650

Merged
RyanTheTide merged 4 commits into
mainfrom
fix/apple-pmc-unhanded-pmp
Dec 1, 2026
Merged

RyanTheTide merged 4 commits into
mainfrom
fix/apple-pmc-unhanded-pmp

Conversation

@erikwb

@erikwb erikwb commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What: A board DT can leave its PMP's apple,board-id and apple,dram-vendor-id to the boot loader. Under a loader that does not fill them in, the PMP never starts: the PMC that names it deferred forever, so its CLPC child, and cpufreq with it, never came up, and the PMP report polled once a second for good. A PMC that also gives the PMP's voter agent in the new apple,pmp-voter now runs without that agent, and a report that names such a PMP in apple,pmp stops waiting for it. Each logs once. Needed before the J716c starts its PMP (#3651, stacked on this branch).

Tested: J716c (16-inch M5 Max) at 292954d133ce, on the stack with #3651 (rows built at 5b7c45fcd7fb, which differs from this stack only in a header's SPDX line and a DT comment). With the current loader, the PMP starts and PMC static agents are 0xb (PMP, CLPC, AP). With a loader that does not fill in the PMP values, the PMC probes without the PMP (agents 0xa), cpufreq runs on all three clusters and the report does not poll. Default command line, no new kernel errors, failed units the same as the default kernel (no SELinux on this distribution). J713 (M4 Air) at 292954d133ce (main + this branch, the daily's config), unaffected as expected: no apple,pmp-voter, PMC static agents 0x8 and rail enables 0x9 as on the daily, PMP starts, cpufreq on both clusters, no new kernel errors beyond plain main's external-display ones, 0 failed units. arm64 KUnit apple-pmc and apple-pmp-report 31/31; dt_binding_check on both bindings: 0 messages.

Risk: two-way door · J716c only: nothing changes without apple,pmp-voter (PMC) or a report apple,pmp naming an enabled PMP without board values, and today only #3651 sets them.

Not yet: nothing.

Details
  • PMC: with apple,pmp-voter, the PMC waits for its PMP only when the PMP node is available and has both values as u32 cells, which is what the PMP driver itself refuses to start without (apple_pmp_has_board_values()). Otherwise it skips the device link and clears that agent from apple,static-voters, after checking it against the PMC's agent count. Without apple,pmp-voter the PMC waits for its PMP as before.
  • Report: a report whose apple,pmp names an enabled PMP without the values keeps its requests to itself and does not start its readiness poll. It still binds, as it does while it waits. Reports without apple,pmp, or whose apple,pmp names a disabled PMP (the display hand-off case), are unchanged.
  • Bindings: apple,pmp-voter (uint32, requires apple,pmp) on the PMC; the PMP report's apple,pmp description now also covers a PMP whose values the loader fills in.
Evidence

J716c (16-inch M5 Max), system and OS firmware 27.2, kernel 7.3.0-ewb391+ = main de965eb5b26b + this branch + the J716c PMP DT commit, built at 5b7c45fcd7fb (the heads now, 292954d133ce and 2a439a39eecc, differ only in pmp-handoff.h's SPDX line and a DT comment). One-shot trial boots under a watchdog dead-man, default command line. Trial DTB: t6050-j716c.dts at 5b7c45fcd7fb with #include "t6050-media.dtsi" left out (main hangs the J716c at boot with it, #3618); nothing else differs.

Boot Loader PMP PMC static agents Report cpufreq
hand-off current default binds, PMP started 0xb (PMP, CLPC, AP) on DCS and SoC PMP running (status 0x1), requests 0x1000047000 3 clusters, apple-cpufreq
no hand-off 2026-11-22 Stage 2 (fills no T6050 PMP values) property 'apple,dram-vendor-id' is missing, probe -22 0xa (CLPC, AP), ... was not handed over; running without its votes ... was not handed over; not waiting for it, running: 0 3 clusters, apple-cpufreq

Kernel err-level messages on the hand-off boot: the same set as on the default kernel (7.3.0-ewb342+): the systemd-gpt-auto-generator pair and aurora ... gpu: M5 bare-metal bootstrap failed at session: EPROBE_DEFER. The no-hand-off boot adds only the two apple_pmp probe lines above. Failed units on both: aurora-peripherals.service, which fails the same way on the default kernel. No SELinux on this distribution.

  • arm64 QEMU KUnit (drivers/pmdomain/apple/.kunitconfig.apple-pmp + CONFIG_APPLE_PMC_KUNIT_TEST): 31/31, apple-pmc 17/17.

  • make dt_binding_check DT_SCHEMA_FILES=power/apple,pmc.yaml and =power/apple,t8140-pmp-report.yaml: 0 messages.

  • J713 (13-inch M4 Air, T8132), firmware 27.2: kernel 7.3.0-j713pmc+ = main de965eb5b26b + this branch at 292954d133ce, built with the J713 daily's config, one GRUB one-shot on the default command line plus panic=10. Compared with the daily (7.3.0-j713-272en4) on the same Mac: PMC static agents: 0x8, rail0/rail1 enable: 0x9 on both; apple_pmp ...: PMP started and J713 PMP vote bridge ready on both; no was not handed over line; apple-cpufreq on policy0 and policy1. Kernel err-level messages: the daily's three, plus external display processor unusable (probe failed: -110) for the two external DCPs, which plain main shows on the J713 without the dock-display PRs, and watchdog0: watchdog did not stop! at the reboot back. 0 failed units.

A board DT can leave a PMP's apple,board-id and apple,dram-vendor-id to
the boot loader, which fills them in from the running machine. Without
them the PMP never starts, and the PMC and the PMP report should not
wait for it.

Add apple,pmp-voter to the PMC, the voter agent of the PMP it names in
apple,pmp, so that the PMC can leave that agent out of its static voters
when the PMP was not handed over. Let a PMP report name such a PMP in
apple,pmp.

Signed-off-by: Erik Bourget <[email protected]>
…over

A board DT can leave the PMP's apple,board-id and apple,dram-vendor-id to
the boot loader, which fills them in from the running machine. Under a
boot loader that does not, the PMP driver fails its probe for good, and a
PMC that names that PMP in apple,pmp defers forever: its CLPC child, and
cpufreq with it, never probes.

When the PMC also gives the PMP's voter agent (apple,pmp-voter), wait for
the PMP only when it is available and has both values. When it does not,
say so once, skip the device link and leave that agent out of the static
voters, so the PMC and CLPC run as on a board without a PMP. A PMC
without apple,pmp-voter waits for its PMP as before.

Signed-off-by: Erik Bourget <[email protected]>
…d over

A PMP report whose PMP is not running yet keeps the devices' requests to
itself and polls until the PMP runs, every 100 ms at first and then once
a second. A PMP whose board values (apple,board-id and
apple,dram-vendor-id) the boot loader did not fill in never starts, so
that poll never ends.

When the report names an enabled PMP in apple,pmp and that PMP lacks the
values, say so once and do not start the poll. The report still binds
and keeps its requests, as it does while it waits. Reports that name no
PMP, or a disabled one, wait as before.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb marked this pull request as ready for review November 30, 2026 21:18
@erikwb
erikwb requested review from a team as code owners November 30, 2026 21:18
@erikwb
erikwb requested review from LiamRay11 and maralcbr November 30, 2026 21:18
@github-actions github-actions Bot added area:power Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at a377282e: not ready yet

Check Detail
CI at head ok 17 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at a377282e
Conflicts ok none
PR text ok Risk: two-way · J716c only: nothing changes without apple,pmp-voter (PMC) or a report apple,pmp naming an enabled PMP without board values, and today only #3651 sets them.

Areas: area:gpu, area:power

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at 292954d1

Blockers:

  1. Host tests CI is still queued at 292954d1. Device tree checks, PMGR power state KUnit, SEP source checks, pr-text, and pr-readiness all passed; wait for Host tests to finish green.

Checked:

  • Full 5-file diff (apple,pmc.yaml, apple,t8140-pmp-report.yaml, drivers/pmdomain/apple/pmc.c, pmp-handoff.h, pmp-report.c, +80/-2), MERGEABLE against main.
  • apple_pmc_probe() cleanly checks apple,pmp-voter + of_device_is_available(pmp_node) && apple_pmp_has_board_values(pmp_node), balances of_node_put(pmp_node), bounds-checks pmp_voter >= pmc->hw->agents, and clears BIT(pmp_voter) from pmc->static_agents only when the PMP was not handed over.
  • Dual-generation exact-head hardware proof at 292954d133ce: J716c (M5 Max) tested both with PMP handoff (0xb) and without (0xa, cpufreq active on all 3 clusters, no report polling) plus J713 (M4 Air) regression row (0x8/0x9 unchanged, cpufreq active, 0 failed units) and 31/31 arm64 KUnit + clean dt_binding_check.
Evidence
  • Code, bindings, KUnit, and dual-generation hardware rows (J716c + J713) are complete; strictly awaiting queued Host tests at 292954d1.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CHANGES_REQUESTED at 292954d1

Blockers:

  • PR-introduced host-tests CI failure (t6030-pmp-graph-tests and t6030-pmp-graph-tests --mutations, 844/846 passed): tools/asahi/t6030-pmp-graph-tests.py fails to compile the extracted production code at production.h:1098:20:
    error: call to undeclared function 'apple_pmp_report_pmp_handed_over'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    (if (rep->defer && apple_pmp_report_pmp_handed_over(rep))). Please update tools/asahi/t6030-pmp-graph-tests.py (or its extraction list / stubs) so both t6030-pmp-graph-tests and --mutations build and pass cleanly.

Checked:

  • Inspected host-tests job 142145179614 (run 46297860710): all other 844 host tests passed; only t6030-pmp-graph-tests and t6030-pmp-graph-tests --mutations failed due to the new apple_pmp_report_pmp_handed_over() call added by this PR.
Evidence
  • Failed CI job: https://github.com/aurora-silicon/linux/actions/runs/46297860710/job/142145179614 (844/846 passed, t6030-pmp-graph-tests + --mutations compile error on apple_pmp_report_pmp_handed_over).

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
The report probe now checks whether the loader supplied both PMP board properties. Extract that predicate and its board-value helper into the host fixture before the probe. Exercise missing and disabled PMP nodes, each missing property and a complete handoff. Keep historical source checks working when the probe predates this helper.

Signed-off-by: DjDeveloperr <[email protected]>
@DjDeveloperr
DjDeveloperr self-requested a review as a code owner November 30, 2026 22:24
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 30, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at a377282e

Blockers:

  • Queued hosted CI at a377282e (2P/0F/9Q): Waiting for host-tests (including updated t6030-pmp-graph-tests and --mutations), apple-build, and KUnit suites to complete green. Once CI passes, this is ready to approve.

Checked:

  • Audited commit a377282e (tools: asahi: exercise the PMP handoff in the T6030 graph fixture):
    • Cleanly resolves the prior t6030-pmp-graph-tests compile failure on apple_pmp_report_pmp_handed_over() by extracting both apple_pmp_report_pmp_handed_over() and apple_pmp_has_board_values() when present in source.
    • Adds test_pmp_handoff() in tools/asahi/t6030-pmp-graph-tests.c exercising all 6 combinations of pmp presence/availability/apple,board-id/apple,dram-vendor-id and verifying pmp.refs == 0.
  • Zero driver/kernel changes vs 292954d1, so the prior J716c and J713 hardware rows remain valid.
Evidence
  • Head commit: a377282e9c3133d516e064aedf4d884f73c6edb6 (MERGEABLE into main).
  • CI snapshot: 2P/0F/9Q.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Fixed the T6030 graph fixture in a377282. It now compiles the production PMP handoff checks, passes the graph suite, and rejects all 25 negative controls.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at a377282e9c31

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: - Audited commit a377282e (tools: asahi: exercise the PMP handoff in the T6030 graph fixture):

  • Cleanly resolves the prior t6030-pmp-graph-tests compile failure on apple_pmp_report_pmp_handed_over() by extracting both apple_pmp_report_pmp_handed_over() and apple_pmp_has_board_values() when present in source.
  • Adds test_pmp_handoff() in tools/asahi/t6030-pmp-graph-tests.c exercising all 6 combinations of pmp presence/availability/apple,board-id/apple,dram-vendor-id and verifying pmp.refs == 0.
  • Zero driver/kernel changes vs 292954d1, so the prior J716c and J713 hardware rows remain valid.

Follow-ups (not blocking): queued hosted CI

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at a377282e9c31 (B2 merge train, 12-01 merge bar). Approval at this head: aurora-silicon-review[bot]. Row: T6030 comment at a377282. CI: linux train L1 = main 595e754 + #3503 #3499 #3240 #3208 #3696 #731 #2634 #2110 #3325 #3441 #3650 (candidate ef98b31c): Apple driver compile (defconfig + asahi.config, LLVM=1, Rust) pass, Apple DTBs W=1 pass, planned KUnit clpc/dcp-fabric/dcp-topology/dcp-display/pmgr-pwrstate/mt7932/asahi all pass; host-tests green (or path-skipped) at this head. The rest of the hosted run is queued behind the ~19 h backlog. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 31cabbb into main Dec 1, 2026
32 of 42 checks passed
@RyanTheTide
RyanTheTide deleted the fix/apple-pmc-unhanded-pmp branch December 1, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants