Repository navigation
pmgr-misc: PMP resume fix, idle fabric governor and PMP for j314s (carries #91, with review fixes) - #123
Merged
Conversation
Boot leaves the fabric at its high p-state and the driver only lowers it for system suspend, so the fabric stays high whenever the system is awake. On a t6000 MacBook Pro with nothing attached, lowering it while idle saves about 0.5 W with the display off and 0.6 W at half brightness. Add an idle_fabric_pstate parameter, 0 (off) by default. When set, a worker lowers the fabric to that p-state while every cpufreq policy runs at its lowest frequency, no external hold is taken and none of the GPU, AVD and ISP power domains is active (actual state on, or target on with auto power management, as the power domain driver reads them). If any expected voter domain is missing, the governor never lowers. While the fabric is high the worker uses a deferrable timer, so it never wakes an idle CPU; while it is low it uses a normal 250 ms timer, which limits how long new load runs at reduced bandwidth (kernel memcpy drops from 23.6 to 14.7 GB/s at fabric 1). This trades burst bandwidth for idle power and is not a bandwidth guarantee. apple_pmgr_fabric_hold() and apple_pmgr_fabric_release() let users the governor cannot see keep the fabric up; a hold raises it and waits until the hardware reports the boot p-state. The worker starts and stops with the parameter, prepare stops it and raises the fabric before any device suspends, and complete restarts it. Bind attributes are suppressed so the workers and holders cannot outlive the driver. Signed-off-by: Marcelo Alcantara <[email protected]>
External display domains stay powered even when idle, so the pmgr-misc idle fabric governor cannot tell from them whether an external display is active. Take a fabric hold before an external CRTC powers up and release it when the CRTC turns off, so scanout never starts or runs on a lowered fabric. The internal display was qualified at the low fabric p-state and does not hold it. Signed-off-by: Marcelo Alcantara <[email protected]>
With PMP enabled in the device tree, its firmware manages system power states, including the fabric (p-state 3 while awake on t6000) and DCS (6). pmgr-misc still wrote its own suspend p-states for both in suspend_noirq and restored the boot ones in resume_noirq; on a t6000 MacBook Pro the system then never woke from s2idle. Testing each write on its own showed the DCS write is the one that breaks resume. The fabric write is safe and matters: with the fabric at its suspend p-state, s2idle power with nothing attached drops from 2.62 W to 2.27 W at the 5 V input. When the PMP node is available, lower only the fabric for suspend, saving PMP's desired fabric p-state and handing it back on resume, and leave DCS alone. Keep the idle fabric governor off and make fabric holds delegate to the firmware. This keys on the device tree configuration rather than on the PMP driver having booted its firmware. Signed-off-by: Marcelo Alcantara <[email protected]>
Let m1n1 enable the Power Management Processor on the 14-inch MacBook Pro (M1 Pro). PMP runs the fabric at p-state 3 and DCS at 6 while awake instead of the boot 7 and 9. Measured with nothing attached: awake idle from the battery drops by about 0.8 W with the backlight at 0 and by about 1.0 W with the display off (5.0 to 4.0 W). PMP only resumes from s2idle when pmgr-misc leaves DCS alone; with pmgr-misc lowering just the fabric for sleep, s2idle power with nothing attached is 2.27 W at the 5 V input: 0.35 W below PMP with no host writes and 0.45 W below the standard configuration. The earlier variant that skipped all host writes woke 10 of 10 timed wakes with a Thunderbolt peer attached; the fabric-only variant is qualified separately. Only j314s has been qualified; other t600x boards keep PMP off. Signed-off-by: Marcelo Alcantara <[email protected]>
Review fixes on top of the idle fabric and PMP sleep series (#91): - PMP sleep path: the suspend write that leaves DCS to PMP was chosen when the PMP node was available in the device tree. On a j314s whose PMP driver is not bound (module not loaded, or the boot loader passed no PMP values) nothing manages DCS, and sleep would keep it at its boot p-state. Each suspend now checks in prepare that the PMP device has a driver bound, and otherwise takes the path without PMP, as on every other t600x. The governor is still refused wherever PMP is described, and fabric holds still don't raise there. - Missing bandwidth voters: desktops (Mac Studio, mini and Pro) have no ISP power state, so every boot warned that the governor would stay high, with the governor off. The warning is now given only when the governor is asked for, at probe or when the parameter is set. - The driver instance is published with a release and read with an acquire, so a hold from the display driver sees it set up. - Comments: the j314s DT comment now says pmgr-misc leaves DCS to PMP and lowers only the fabric for sleep, and the unbind comment says the workers would outlive an unbind. No change on Macs without pmgr-misc (M1, M2, M3), and none on t600x and t602x at default settings beyond the warning that is now debug only. Signed-off-by: Chris Kearney <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
J314S (14" M1 Pro) with PMP, Aurora 2026.10.15.19 ( External displays under PMP (the open point above):
s2idle under PMP:
The LG + HDMI case fails the same way with the PMP driver kept from starting ( Only seen with PMP on:
Not measured: idle power with and without PMP, and the governor. |
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.
Supersedes #91 by @maralcbr. His four commits are carried unchanged, with one review-fix commit on top. We can't push to his fork, so the fix commit is on an omacom branch.
What #91 does (j314s, 14" M1 Pro):
apple_pmgr_misc.idle_fabric_pstate, off by default.Review fixes (the last commit):
Behaviour at default settings, by Mac. From two adversarial reviews, with file:line evidence in the review notes:
Tests:
Display KUnit: 225 tests, 223 pass. The one failure and one skip are the same as on base.
Thunderbolt and tipd KUnit: 84/84 and 35/35, on the combined tree with thunderbolt: apple: opt-in port power-off for s2idle with CD321x restore #92's carry.
Build: release-config W=1 builds of the touched directories show no warnings in the changed files.
M1 Air lab job on the combined tree: job
j1015-004326-2f04, package7.1.12-2-20261015.992built from this combined tree, passed:idle_fabric_pstate=0,s2idle_teardown,resume_recoveryandrouter_sleepall N);No external display was attached for this run, so the M1 external-pipe hold path was not driven. It returns early on t8103, because pmgr-misc is not bound there.
Author's measurements: the j314s numbers in pmgr-misc: PMP resume fix, idle fabric governor and PMP for j314s #91. We have no j314s, so the lab can't exercise the PMP path or the governor.
Not covered:
Keeping the governor opt-in is right: it trades burst bandwidth for idle power, and has run on one t6000 only.
🤖 Generated with Claude Code