Repository navigation
pmdomain: apple: run the PMC and PMP report without a PMP the boot loader did not hand over - #3650
Conversation
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]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: HOLD at 292954d1
Blockers:
Host testsCI is still queued at292954d1.Device tree checks,PMGR power state KUnit,SEP source checks,pr-text, andpr-readinessall passed; wait forHost teststo 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),MERGEABLEagainstmain. apple_pmc_probe()cleanly checksapple,pmp-voter+of_device_is_available(pmp_node) && apple_pmp_has_board_values(pmp_node), balancesof_node_put(pmp_node), bounds-checkspmp_voter >= pmc->hw->agents, and clearsBIT(pmp_voter)frompmc->static_agentsonly 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/0x9unchanged, cpufreq active, 0 failed units) and 31/31 arm64 KUnit + cleandt_binding_check.
Evidence
- Code, bindings, KUnit, and dual-generation hardware rows (J716c + J713) are complete; strictly awaiting queued
Host testsat292954d1.
There was a problem hiding this comment.
Verdict: CHANGES_REQUESTED at 292954d1
Blockers:
- PR-introduced
host-testsCI failure (t6030-pmp-graph-testsandt6030-pmp-graph-tests --mutations, 844/846 passed):tools/asahi/t6030-pmp-graph-tests.pyfails to compile the extracted production code atproduction.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 updatetools/asahi/t6030-pmp-graph-tests.py(or its extraction list / stubs) so botht6030-pmp-graph-testsand--mutationsbuild and pass cleanly.
Checked:
- Inspected
host-testsjob142145179614(run46297860710): all other 844 host tests passed; onlyt6030-pmp-graph-testsandt6030-pmp-graph-tests --mutationsfailed due to the newapple_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+--mutationscompile error onapple_pmp_report_pmp_handed_over).
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]>
There was a problem hiding this comment.
Verdict: HOLD at a377282e
Blockers:
- Queued hosted CI at
a377282e(2P/0F/9Q): Waiting forhost-tests(including updatedt6030-pmp-graph-testsand--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-testscompile failure onapple_pmp_report_pmp_handed_over()by extracting bothapple_pmp_report_pmp_handed_over()andapple_pmp_has_board_values()when present insource. - Adds
test_pmp_handoff()intools/asahi/t6030-pmp-graph-tests.cexercising all 6 combinations ofpmppresence/availability/apple,board-id/apple,dram-vendor-idand verifyingpmp.refs == 0.
- Cleanly resolves the prior
- Zero driver/kernel changes vs
292954d1, so the priorJ716candJ713hardware rows remain valid.
Evidence
- Head commit:
a377282e9c3133d516e064aedf4d884f73c6edb6(MERGEABLEintomain). - CI snapshot:
2P/0F/9Q.
|
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. |
There was a problem hiding this comment.
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-testscompile failure onapple_pmp_report_pmp_handed_over()by extracting bothapple_pmp_report_pmp_handed_over()andapple_pmp_has_board_values()when present insource. - Adds
test_pmp_handoff()intools/asahi/t6030-pmp-graph-tests.cexercising all 6 combinations ofpmppresence/availability/apple,board-id/apple,dram-vendor-idand verifyingpmp.refs == 0. - Zero driver/kernel changes vs
292954d1, so the priorJ716candJ713hardware rows remain valid.
Follow-ups (not blocking): queued hosted CI
|
Merging at |
What: A board DT can leave its PMP's
apple,board-idandapple,dram-vendor-idto 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 newapple,pmp-voternow runs without that agent, and a report that names such a PMP inapple,pmpstops 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 at5b7c45fcd7fb, 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 are0xb(PMP, CLPC, AP). With a loader that does not fill in the PMP values, the PMC probes without the PMP (agents0xa), 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) at292954d133ce(main + this branch, the daily's config), unaffected as expected: noapple,pmp-voter, PMC static agents0x8and rail enables0x9as on the daily, PMP starts, cpufreq on both clusters, no new kernel errors beyond plain main's external-display ones, 0 failed units. arm64 KUnitapple-pmcandapple-pmp-report31/31;dt_binding_checkon both bindings: 0 messages.Risk: two-way door · J716c only: nothing changes without
apple,pmp-voter(PMC) or a reportapple,pmpnaming an enabled PMP without board values, and today only #3651 sets them.Not yet: nothing.
Details
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 fromapple,static-voters, after checking it against the PMC's agent count. Withoutapple,pmp-voterthe PMC waits for its PMP as before.apple,pmpnames 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 withoutapple,pmp, or whoseapple,pmpnames a disabled PMP (the display hand-off case), are unchanged.apple,pmp-voter(uint32, requiresapple,pmp) on the PMC; the PMP report'sapple,pmpdescription 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 at5b7c45fcd7fb(the heads now,292954d133ceand2a439a39eecc, differ only inpmp-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.dtsat5b7c45fcd7fbwith#include "t6050-media.dtsi"left out (main hangs the J716c at boot with it, #3618); nothing else differs.PMP started0xb(PMP, CLPC, AP) on DCS and SoCPMP running (status 0x1), requests 0x1000047000apple-cpufreqproperty 'apple,dram-vendor-id' is missing, probe-220xa(CLPC, AP),... was not handed over; running without its votes... was not handed over; not waiting for it,running: 0apple-cpufreqKernel err-level messages on the hand-off boot: the same set as on the default kernel (
7.3.0-ewb342+): thesystemd-gpt-auto-generatorpair andaurora ... gpu: M5 bare-metal bootstrap failed at session: EPROBE_DEFER. The no-hand-off boot adds only the twoapple_pmpprobe 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-pmc17/17.make dt_binding_check DT_SCHEMA_FILES=power/apple,pmc.yamland=power/apple,t8140-pmp-report.yaml: 0 messages.J713 (13-inch M4 Air, T8132), firmware 27.2: kernel
7.3.0-j713pmc+= mainde965eb5b26b+ this branch at292954d133ce, built with the J713 daily's config, one GRUB one-shot on the default command line pluspanic=10. Compared with the daily (7.3.0-j713-272en4) on the same Mac: PMCstatic agents: 0x8,rail0/rail1 enable: 0x9on both;apple_pmp ...: PMP startedandJ713 PMP vote bridge readyon both; nowas not handed overline;apple-cpufreqon policy0 and policy1. Kernel err-level messages: the daily's three, plusexternal display processor unusable (probe failed: -110)for the two external DCPs, which plain main shows on the J713 without the dock-display PRs, andwatchdog0: watchdog did not stop!at the reboot back. 0 failed units.