Repository navigation
soc: apple: T8140 PMC voters, CLPC DCS/fabric floors and GFX PMP report - #212
Closed
DjDeveloperr wants to merge 5 commits into
Closed
DjDeveloperr wants to merge 5 commits into
DjDeveloperr wants to merge 5 commits into
Conversation
The PMP chooses DRAM and fabric performance states partly from the power state that the host reports for the devices it tracks. On macOS, ApplePMGR sets a device's bit in the PMP's power-state request word after it powers the device on, clears it before it powers the device off, and waits for the PMP to acknowledge the devices that require it. The pmp-report driver already provides such report entries as power domains on earlier SoCs. Allow them as children of the T8140 report aperture, with the device's PMP soc-device index as the unit address. Assisted-by: LLM Signed-off-by: Diljit Singh <[email protected]>
The PMC arbitrates the performance states of shared rails, such as the DRAM controller and the SoC fabric, between voter agents: the PMP, the host performance controller (CLPC), the GPU and the application processor. Each agent has a perf-state floor word with one 4-bit state per rail, and each rail has an interface enable word with one bit per agent; the PMC ignores the floor of an agent that is not enabled on a rail. Describe the voter and rail windows, the static agents, the dynamic agents as power domains, and the host performance controller's agent. Assisted-by: LLM Signed-off-by: Diljit Singh <[email protected]>
The PMC only honours a voter agent's perf-state floor on rails where that agent's interface is enabled. macOS enables the static agents (PMP, CLPC and AP) on all their rails when it restores the PMGR (ApplePMC::restorePMC), and enables a dynamic agent such as the GPU only while the host keeps the agent's PMGR device powered: after the power-on state write and before the power-off one (ApplePMC::stateChange). Without these enables, the PMC ignores those agents' floors. Enable the static agents listed in the device tree for as long as the PMC is bound, and restore the saved enable words when it is unbound. Provide each dynamic agent as a power domain whose parent is its device's power domain, so that genpd enables the agent after the parent powers on and disables it before the parent powers off, as macOS does. Every enable write is read back. Export the floor words so that a host performance controller can set its agent's floor. Assisted-by: LLM Signed-off-by: Diljit Singh <[email protected]>
On macOS the CLPC raises the DRAM controller (DCS) and SoC fabric floors of its PMC voter agent while the CPU clusters or the GPU are busy (AppleT8140CLPC: clpc::memory::DVFManager and clpc::soc::DVFManager, both ending in the PMC CLPC perf-state floor), and lets them fall at idle. Linux has no equivalent, so CPU-bound work runs with the DRAM controller at whatever state the other agents happen to request. Sample every cpufreq policy every 4 ms, the CLPC sampling interval from the Apple device tree. A policy whose busiest CPU was busy for at least half of the period requests a DCS and fabric state from a table indexed by its frequency quartile. Optionally, while the GPU's PMGR state reports the GPU as actually powered, request a fixed GPU floor. Each rail keeps its last request for 32 ms after demand stops, then returns to 0. The native mapping from CPU and GPU demand to DCS and fabric states is not decoded. The default tables (DCS 1-4 by quartile, no fabric request, no GPU floor) are measured policy and can be changed with module parameters. A debugfs file holds a rail at a fixed state for diagnosis only. Assisted-by: LLM Signed-off-by: Diljit Singh <[email protected]>
Describe the PMC voter interface with the PMP, CLPC and AP agents as static voters, the GPU's dynamic agent as a power domain, and the host performance controller's agent. Add the PMC's PMGR power state. Report the GPU to the PMP through a report entry for PMP soc-device 9, whose type in the Apple device tree requires an acknowledgment. The GPU now sits on the PMC GFX agent, which sits on the report entry, which sits on the GFX PMGR state. Powering the GPU on therefore writes the PMGR state, then reports it to the PMP, then enables its PMC agent, and powering it off undoes them in reverse order, as macOS does. Enable the PMC on J700. Assisted-by: LLM Signed-off-by: Diljit Singh <[email protected]>
RyanTheTide
added a commit
that referenced
this pull request
Oct 9, 2026
soc: apple: T8140 PMC voters, CLPC floors, GFX PMP report and a DCS thermal limit (supersedes #212)
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.
Adds PMC voter enables and CLPC demand floors for DRAM controller (DCS) and SoC fabric performance on T8140, and reports the GPU's power state to the PMP. These are clean, generic versions of the lab modules
neo_pmc,neo_pmpdashandneo_clpc. They take their registers from the device tree and build on the existingpmp.rsandpmp-reportinstead of adding a second PMP driver.Draft: not tested on hardware yet. See "Testing" below.
What it does
drivers/pmdomain/apple/pmc.c,apple,t8140-pmc). The PMC only honours a voter agent's perf-state floor on rails where that agent's interface is enabled.ApplePMC::restorePMCdoes.ApplePMC::stateChangedoes.drivers/soc/apple/clpc.c,apple,t8140-clpc, a child of the PMC). Every 4 ms, which is the ADT CLPC sampling interval, it raises the DCS/fabric floor of the CLPC agent from cpufreq load: a busy cluster requests a state indexed by its frequency quartile. Each rail holds its request for 32 ms after demand stops, then drops to 0.gpu_dcs/gpu_soc) is off by default.forcefile holds a rail at a fixed level, for diagnosis only.ps_pmc), the CLPC child and the GFX voter.pmc_gfx→pmp_report_gfx→ps_gfx. GPU power-on now writes the PMGR state, then reports it to the PMP, then enables its PMC agent; power-off runs in reverse. That is macOS's_enableDeviceGatedorder.Not included
pmp.rspatches 3. Whether the PMP votes through the PMC without the PMC* keys is not known yet.pmp-reportfails a power-on after 50 ms without one. They stay out until their acknowledgment behaviour is measured.neo_mcc) and the fast-die module.Testing
Done:
dt_binding_checkpasses for both bindings;Not done: hardware. Neo's DT comes from its m1n1 payload, so these DT changes can't be booted on it as they are. The planned test runs on the current lab boot instead:
neo_clpc.The PR stays a draft until that passes.
Assisted-by: LLM