Skip to content

pmgr-misc: PMP resume fix, idle fabric governor and PMP for j314s - #91

Merged
4 commits merged into
omacom:integration/aurorafrom
maralcbr:pr/idle-fabric-pmp
Oct 15, 2026
Merged

4 commits merged into
omacom:integration/aurorafrom
maralcbr:pr/idle-fabric-pmp

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Summary

Battery work on the 14-inch M1 Pro (t6000, j314s). Four commits:

  1. pmgr-misc: lower the fabric p-state while the system idles. Boot leaves the fabric at p-state 7, and pmgr-misc only lowers it for suspend, so it stays high whenever the system is awake. A new apple_pmgr_misc.idle_fabric_pstate parameter (default 0, off) lowers it while every cpufreq policy sits at its minimum and the GPU, AVD and ISP power domains are off. It raises the fabric again as soon as any of that changes.
  2. drm: apple: hold the fabric up while an external display scans out. External display domains stay powered even when idle, so they can't vote through their power state. An external CRTC takes a hold before it powers up and drops it when it turns off.
  3. pmgr-misc: keep DCS to PMP, lower only the fabric for sleep. With PMP enabled, the system never woke from s2idle. Testing each write on its own showed pmgr-misc's DCS suspend write is what breaks resume; the fabric write is safe. Under PMP, pmgr-misc now lowers only the fabric for sleep, hands PMP's own fabric choice back on resume, and leaves DCS alone.
  4. dts: t6000-j314s: enable PMP. j314s only, since it's the only board qualified.

Measurements

j314s, Aurora 2026.10.09.8 base, nothing attached. 5 V input power comes from the USB-C port of a second Mac; battery numbers come from the M1's own gauge over 15-minute windows.

Before After Change
Awake, display off, battery 4.98 W 3.96 W (PMP) −1.02 W
Awake, backlight 0, battery 5.96 W 5.18 W (PMP) −0.78 W
s2idle, 5 V input 2.72 W 2.25 W (PMP + fabric-only suspend write) −0.47 W
Awake, backlight 0, 5 V, no PMP 7.49 W 6.95 W (governor at 1) −0.54 W

Resume with PMP: 23 of 23 timed wakes across three runs, 10 of them on the final fabric-only variant with a Thunderbolt peer attached and traffic checked after each wake. The fabric came back at PMP's level 3 after every wake. Before this series, three kernels never woke from s2idle with PMP enabled.

Governor: the fabric was low for 86–92 % of idle samples, and under a CPU busy loop it was back to 7 within a second. Kernel memcpy at fabric 1 is 14.7 GB/s against 23.6 GB/s at 7, so the governor is opt-in and trades burst bandwidth for idle power.

Limits

  • PMP is only qualified on j314s. Other t600x boards keep it off.
  • The fabric save and restore around suspend is a host-side workaround. PMP keeps running through noirq, so resume only restores PMP's value if the register still holds our suspend value. A proper firmware sleep handshake would need reverse engineering.
  • The governor relies on PMGR actual-state votes and CPU frequency; it is not a bandwidth guarantee. It refuses to run when PMP owns the fabric.

Testing

Built for arm64 (16 KiB pages) on this branch. Hardware runs were done on an equivalent lab branch carrying lab-only timed-wake and register-readout patches, which aren't part of this PR.

@iconidentify @DjDeveloperr, could you review? I'd value your view in particular on the PMP ownership split in commit 3 and on enabling PMP for j314s by default.

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]>
@chriskearney

Copy link
Copy Markdown

Thanks @maralcbr, this is merged through #123 with your four commits unchanged and one review-fix commit on top. We can't push to your fork.

The fixes:

  • PMP sleep path: taken only while the PMP device has a driver bound. A j314s whose PMP module didn't load now sleeps the old way, instead of leaving DCS high.
  • Voter warning: the missing-voter warning no longer prints on every desktop boot with the governor off.
  • Instance publication: the driver instance is published with release/acquire.
  • Comments: two comment fixes.

The default path was checked on our M1 Air (lab job j1015-004326-2f04, 0 regressions). The j314s PMP and governor paths rest on your measurements. One open point from review: no high-resolution external display has run under PMP yet. Details are in #123.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants