Repository navigation
soc: apple: enable T8140 PMP firmware limits alongside IPA - #179
Merged
Merged
Conversation
The T8140 PMP DART DMA window starts at 1 TiB. The default 32-bit DMA mask leaves no usable IOVA, so the firmware's first buffer request fails with ENOMEM and probe times out. Set the mask before allocating any firmware buffers, using per-SoC match data. Retain the default mask on existing SoCs. Port Ryan Murray's Linux-observed T8140 fix onto the existing Asahi PMP driver by Sasha Finkelstein, including Janne Grunau's fixup. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Describe the T8140 report layout from the Apple device tree and expose its fast-die effort through the existing PMP report mapping. A stopped PMP reads zero, so check the running bit before accepting an effort. Report entry 0x1c1 contains byte 1 for the P cluster, observed under Linux load, and byte 0 for E, assigned from ADT lane order. The E byte has not yet been observed changing. Do not read entry 0x1c2 or scan the unpopulated part of the report aperture. Expose read-only debugfs status and lane effort values for diagnostics. Port the original Linux-derived implementation by Ryan Murray. Retain the Asahi report driver and use it as the sole owner of the mapping. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The PMP publishes a per-cluster effort faster than the SMC reports die temperature. Sample the effort and enforce a maximum-frequency QoS request. The cpufreq core combines it with thermal cooling limits and reports reduced capacity to the scheduler. Keep the existing IPA policy. Use the OPP power table to map increasing effort to a monotonic power ceiling. Until the PMP is running, retain a ceiling of one third of the maximum OPP power. Deferrable timers sample busy CPUs without waking idle clusters; an hrtimer follows a reduced ceiling so idle capacity can recover. Drain timers and update work before removing the QoS request. Port Ryan Murray's original Linux-tested direct limiter. Apply the public IPA series' removal of the obsolete SMC policy hooks while preserving command-state transition verification. Keep the firmware- limit lifecycle separate from the generic policy cleanup so the public thermal-series removals merge without overlapping new hooks. No additional thermal policy or experimental smoothing is introduced. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Document the existing PMP firmware driver resources and the report aperture consumed by the fast-die limiter. Define a report phandle and lane index on the cluster DVFS controller, using the measured P lane and ADT E lane ordering. Firmware calibration properties are populated by the bootloader from the Apple device tree. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Describe the PMP SRAM, ASC, mailbox, DART and report resources from the Apple device tree. The DART register range includes its v2.3 exception registers. Enable the resources on J700 and connect the cluster effort lanes so cpufreq retains its fallback caps until the firmware runs. Leave the firmware-owned PMC domain untouched. The PMP firmware and fast-die maximum-frequency requests complement the existing thermal power allocator; thermal trips and sustainable power remain unchanged. The bootloader must initialize the PMP DAPF and copy its calibration. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The P-cluster DVFS controller provides a performance domain with no arguments. Retain its required cell count when connecting the PMP effort lane so the CPU performance-domain lookup remains valid. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Place the PMP driver, report interface and related bindings under the existing J700 support entry owned by Ryan Murray. Keep project contact information together rather than creating a separate coordination entry. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide
added a commit
that referenced
this pull request
Oct 8, 2026
Preserve the original review commits and retain subsequent published repairs where superseded. 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.
Start the T8140 PMP through the existing Apple PMP driver with a 42-bit DMA mask, expose running-qualified fast-die effort through the existing PMP report driver, and enforce firmware ceilings through cpufreq maximum-frequency QoS. The public thermal power allocator remains the slow policy; its lower ceiling composes with the firmware limit. The DT describes and enables the J700 PMP SRAM, ASC, mailbox, DART and report resources while leaving the firmware-owned PMC state untouched.
The existing PMP base by Sasha Finkelstein and Janne Grunau is already in aurora-wip and retains its original history and attribution. The T8140 additions port Ryan Murray's ADT/Linux-derived work. Report entry 0x1c1 byte1 was observed following P-cluster load under Linux; byte0 is assigned to E from ADT order and has not been observed changing. Memory-controller support remains a separate task.
Bootloader dependency: dart-pmp DAPF preparation and enabled-device admission already exist in public m1n1 PR #2. The loader must include that behavior and copy the PMP calibration before this kernel driver can start the firmware.
Validation:
Neo qualification in progress. No fresh thermal safety PASS is claimed. The qualification owner will verify PMP boot/readiness and telemetry, fallback caps, CPU hotplug/teardown, IPA/QoS interaction and recovery, and a guarded sustained GPU+CPU load below the thermal trips without resets. Full per-boot journals, boot identity and GPU queue/submit-failure guards remain required before fanless-safety approval.
🤖 Generated with Claude Code