Skip to content

pmgr-misc: PMP resume fix, idle fabric governor and PMP for j314s (carries #91, with review fixes) - #123

Merged
chriskearney merged 5 commits into
integration/aurorafrom
carry/pr91-pmgr-misc
Oct 15, 2026
Merged

chriskearney merged 5 commits into
integration/aurorafrom
carry/pr91-pmgr-misc

Conversation

@chriskearney

Copy link
Copy Markdown

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):

  • Idle fabric governor: lowers the fabric p-state while the system idles. It's opt-in through apple_pmgr_misc.idle_fabric_pstate, off by default.
  • Fabric hold: external CRTCs keep the fabric up while they scan out.
  • Sleep under PMP: pmgr-misc lowers only the fabric for sleep and leaves DCS to PMP. This fixes s2idle resume with PMP enabled.
  • DT: PMP is enabled on the j314s.

Review fixes (the last commit):

  • PMP sleep path:
    • The path that leaves DCS to PMP is now taken only while the PMP device has a driver bound, checked in each suspend's prepare.
    • Before, it keyed on the DT node alone. A j314s whose PMP module didn't load, or whose boot loader passed no PMP values, would have kept DCS at its boot p-state through sleep. It now takes the old path, as every other t600x does.
  • Missing-voter warning: "found 2 of 3 bandwidth voters" used to print on every boot of the Mac Studio, mini and Pro, which have no ISP power state, even with the governor off. It's now debug-level unless the governor is asked for.
  • Instance publication: the driver instance is published with release/acquire for the display driver's holds.
  • Comments: the j314s DT comment now matches commit 3, and the unbind comment reads right.

Behaviour at default settings, by Mac. From two adversarial reviews, with file:line evidence in the review notes:

Macs Change
M1 (t8103), M2 (t8112), all M3 none: pmgr-misc isn't bound, and the CRTC holds return early
t600x/t602x laptops other than the j314s no register writes. At probe there are DT and syscon lookups; prepare and complete only take a lock and cancel work
t600x/t602x desktops as above. The voter warning is now debug only
j314s by design: PMP is on if the boot loader enables it; sleep lowers only the fabric; holds don't raise

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, package 7.1.12-2-20261015.992 built from this combined tree, passed:

    • every new parameter reads off (idle_fabric_pstate=0, s2idle_teardown, resume_recovery and router_sleep all N);
    • the Kensington SD5560T dock comes up: its PCIe tunnel shows all four Titan Ridge functions, and both routers are authorized;
    • no kernel WARN, BUG or oops, and no "fabric raise" warning; the GPU red/blue readback passes;
    • omarchy-m-test: 0 regressed against known-good.

    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:

  • External display under PMP: with PMP the fabric hold doesn't raise the fabric, so external scanout depends on PMP raising it. No high-resolution external display has run under PMP yet.
  • Boot loader: PMP on the j314s also needs the boot loader to switch the PMP node on. Without that it falls back safely: the "PMP manages fabric and DCS p-states" line doesn't appear.

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

maralcbr and others added 5 commits October 13, 2026 06:50
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]>
@cb2206

cb2206 commented Oct 20, 2026

Copy link
Copy Markdown

J314S (14" M1 Pro) with PMP, Aurora 2026.10.15.19 (7.1.12-2-20261015.19-sep-ARCH, m1n1 aurora17). m1n1's dt_set_pmp() enabled the node from the pmp alias and passed 59 tunables. The kernel logs PMP manages fabric and DCS p-states, PMP firmware and endpoint ready, PMP started, and once unknown property "apple,tunable-fast-die-ctrl-ce-map". Governor left at its default (idle_fabric_pstate=0).

External displays under PMP (the open point above):

  • LG UltraFine 5K over Thunderbolt: 5120x2880@60 on one connector, both tiles joined.
  • Plus a Dell U2715H on built-in HDMI: the usual handover (HDMI display takes its pipeline back, LG moves to dcpext1), all three outputs lit, no refused commits.

s2idle under PMP:

Run Result
Nothing attached, 9 min resumed, devices resumed in 0.3 s
LG alone (on dcpext0), 3 min, AC resumed, LG back at 5K, 1.2 s
Overnight, nothing attached, 10 h 19 min (AC, the last ~30 min on battery) resumed on lid open, 0.30 s, one continuous sleep
LG + HDMI (LG on dcpext1), 3 min LG stays dark after resume, see below

The LG + HDMI case fails the same way with the PMP driver kept from starting (initcall_blacklist=__apple_pmp_init, one boot), so it isn't a PMP problem; it's filed as #162.

Only seen with PMP on:

  • Every resume with PMP (4 of 4) logs apple-pmgr-pwrstate 28e580000.power-management:power-controller@3c0: PS gfx: Failed to reach power state 0xf (requested 0xf00000f, now: 0xf000b4f). The GPU keeps working afterwards (glxinfo, compositor). The control resume without PMP didn't log it.
  • Touch ID failed twice in five PMP boots/resumes: once after the LG + HDMI resume (sequence counter: session setup failed) and once at boot (the sensor did not answer the challenge). It never failed in the runs without PMP (one boot, one resume). That's a small sample, and this attach failure also happened occasionally before PMP, so treat it as a weak signal only.

Not measured: idle power with and without PMP, and the governor.

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.

3 participants