Repository navigation
T8112: PMP memory and fabric votes (CPU clusters, ANE) - #1343
Closed
RyanTheTide wants to merge 18 commits into
Closed
RyanTheTide wants to merge 18 commits into
RyanTheTide wants to merge 18 commits into
Conversation
The T8112 PMP takes SoC-device performance requests in the SOC-DEV-DVFS range from 0xa8. The E and P clusters (0xa8, 0xa9) and the ANE (0xab) carry a memory (DCS, request class 0x21) and a SoC fabric (class 0x25) constraint in one word. Describe the cpufreq apple,pmp-memory-vote phandle, the ANE performance controller and report domain, the T8112 request classes of the report entries and the T8112 PMP compatible. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
…otes T8112 accepts device performance requests only after the range-ready report (entry 8) is nonzero. When it reads zero, store 1 to its update entry once and wait for the achieved word before the first request; the achieved SoC state (entry 9) is reported in debugfs and never written. On this range a request needs a running PMP; the T600x behaviour is unchanged. Add apple_pmp_report_t8112_clpc_request(), which stores the whole provider-owned word of the E cluster, P cluster or ANE entry: the valid bit, a DCS state (class 0x21, 0..4) and a SoC fabric state (class 0x25, 0..2). Request words use apple_pmp_dvfs_word() and the host-side copy of every stored word is listed in debugfs, which is now created for every report. KUnit covers the range, the ready gate, ACK failure, release order and the vote words; the host tests follow. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
With the PMP running, T8112 DRAM and the SoC fabric stay at their idle state unless the CPU clusters request more. Map each cluster's frequency request to a DCS and fabric state (quartiles: DCS 0/1/3/4, fabric 0/0/1/2) and store it through the PMP report when the cluster has an apple,pmp-memory-vote. Without a running PMP the vote is skipped and the frequency change goes ahead. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Request the top DCS and fabric state on the ANE's PMP entry for each procedure call and release it 32 ms after the last one ends, when the device names an apple,performance-controller. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Under APPLE_USE_PMP the CPU clusters vote memory/fabric states on 0xa8 and 0xa9, the ANE takes the pmp-ane-sys report as an extra domain and votes on 0xab, and the JPEG report entry carries its class 0x21 request. No board selects APPLE_USE_PMP here. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
T8112 CLPC device constraints are only applied to a resident soc-device. Request and wait for the EACC0, PACC0 or ANE0 power-state bit before publishing a nonzero constraint, and store valid-zero before withdrawing a bit owned by this path. Leave a bit already owned by a report domain to that owner. Expose the owned bits in debugfs and cover ACK, rollback and release ordering with KUnit. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Under APPLE_USE_PMP, attach both T8112 JPEG engines to their shared PMP report domain. Runtime PM then refcounts the report across both engines and retains the existing autosuspend hold before the request and performance word are released. Keep the normal board profile unchanged and extend the PMP graph host test for both JPEG consumers. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Keep the single apple,dvfs-request-class definition. Current dtschema rejects the duplicate mapping key before it can validate the T8112 report graph. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Build the EACC0, PACC0 and ANE0 SOC-DEV-DVFS entries and their PS request bits from the soc-device ID instead of an open-coded offset. The entry is the ID from a base of 0xa5 and the request bit is the ID - 1, the same rule the report entries use. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit d3335b5 and its follow-up 45a2bac. On the J413 the PMP never acknowledges PS request bits 2 and 3, so every nonzero EACC0/PACC0 constraint timed out in the admission poll and was rolled back. The cluster words stayed valid-zero, each cpufreq transition spun for 50 ms, and with the PMP on the board fell to 9.3 GB/s memcpy, glmark2 ~1800 and 4.45 W idle. Go back to publishing the constraint word directly. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe the T8112 memory-vote target as a firmware SOC-device constraint. The cpufreq request is queued outside fast-switch rather than published directly through the report aperture. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Use the PMP serialized device-constraint command for the T8112 EACC0, PACC0 and ANE0 DCS/fabric targets. Validate the echoed untagged reply and retain fail-safe raise and release ordering. Queue CPU votes from fast-switch and perform the command exchange in workqueue context, so a firmware reply can never busy-wait a CPU frequency transition. Keep ANE job votes synchronous in process context. Drop the direct CLPC report-aperture API and cover command correlation with KUnit. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Name the T8112 PMP report provider in the APPLE_USE_PMP profile so firmware constraint commands wait for the matched running report. Extend the baseline and opt-in graph test; shipping profiles remain PMP-off. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Build the EACC0, PACC0 and ANE0 constraint targets, their DVFS entries and the qualified DCS/SoC-fabric maxima from named SOC-device IDs instead of open-coded numbers, and build the command KUnit vectors from the request fields. Record each acknowledged step of a constraint exchange, so a partially completed raise or release is retried from the level the firmware accepted. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
The CPU vote is requested from cpufreq fast-switch, which the scheduler calls with a runqueue lock held. Queueing a work item there can wake a worker on the same runqueue and deadlock the CPU. Hop through an irq_work first, as schedutil does, and only queue when the vote changes or the last command failed. The constraint command waited for a supplier-ready report that only the J613 and T8132 report types satisfy, so on T8112 every command returned -ENODEV and was dropped. Accept the T8112 report and require it to be running with its SOC-DEV-DVFS range ready. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
Retry a vote that failed because the PMP is not up yet at most once a second, and stop voting for the policy after a rejected or lost command. Retrying every request after a failure re-queued the worker at the scheduler rate and kept the CPUs busy. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
T8112 device constraints use the command-complete opcode and carry the performance domain before the SOC-device target. Require both fields to be echoed so a zero-target completion cannot be applied to an outstanding constraint. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Exercise the same running-report and entry-8 readiness path used before a T8112 constraint command. This keeps the supplier path covered without stubbing away the gate. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
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.
T8112 (M2) PMP memory and fabric votes for the CPU clusters and the ANE, sent as PMP device-constraint commands. Everything is under
APPLE_USE_PMP; no board enables it.apple_pmp_set_device_constraint()sends serialized device-constraint commands (performance domain, SOC-device target, level; the completion must echo domain and target) for EACC0, PACC0 and ANE0. DCS is raised before the fabric and lowered after it, and each acknowledged step is cached. The command waits for a running T8112 report whose SOC-DEV-DVFS range is ready.Tests: KUnit apple_pmp_command, apple-pmp-start/-dvfs/-report/-dram/-ane pass (77/78, 1 unrelated skip); PMP DT host tests pass; arm64 W=1 on the touched objects is clean.
M2 (J413), RAM-only trial boots, same fleet base for both columns:
Not ready: the PMP answers the first constraint command with
0x0021000000000000(opcode 0x10, no domain/target echo) in both request layouts tried. The reply check rejects it and disables PMP commands, so no vote is applied and the SoC stays at its floor.A one-boot raw-command probe sent four request layouts (opcodes 0x0f and 0x0c, both field orders) for EACC0 DCS 4: each got the same
0x0021000000000000, and entry 9, the published EACC0/PACC0 words and memcpy stayed unchanged. The PMP endpoint does not carry constraints on T8112, so this branch will move back to publishing the votes through the report aperture.🤖 Generated with Claude Code