Skip to content

T8112: enable PMP with CPU memory floor and display clock scaling - #3789

Merged
RyanTheTide merged 6 commits into
mainfrom
fix/t8112-pmp-display-floor
Dec 1, 2026
Merged

RyanTheTide merged 6 commits into
mainfrom
fix/t8112-pmp-display-floor

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Tested: J473 M2 mini at 098b53c (tree-identical to tested build 0dbd7ed7): 0 failed units, SELinux Enforcing, 0 AVC, PMP running (0x600 acked), P 38.6 / E 17.6 GB/s memcpy, 144/165/180/240/280 Hz mode sweep + live DVFS-STATE scaling 0x101->0x301->0x101, DPMS off/on PASS, 30-min soak (37 mode cycles) 0 crashes / 0 timeouts.
Risk: two-way · T8112 (M2)

Summary

Enable the T8112 (M2) Power Management Processor (PMP) with its demand-driven CPU memory floor and display clock scaling, fixing both the PMP-on external display mode-set timeout (set_digital_out_mode timed out) and the locked 360 MHz display clock cap (Ref #3604).

Root Causes & Fixes (5 commits, 5 files, +139 / -32 lines incl. KUnit)

  1. soc: apple: pmp: confirm T8112 registry updates with the registered length (drivers/soc/apple/pmp.rs)
    • Set confirm_ioreg_len: true on HW_CFG_T8112 so the three startup UPDATE_IOREG requests receive CONFIRM_IOREG 8 (matching each entry's registered length), as on T8132.
  2. pmdomain: apple: pmp-report: defer T8112 requests and support wait_ready (drivers/pmdomain/apple/pmp-report.c, drivers/pmdomain/apple/pmp-report-start-test.c)
    • Set .defer_requests = true on apple_pmp_offsets_t8112 so early boot power-domain requests (probed before apple_pmp starts the firmware) stay in rep->shadow until PMP-STATUS reports running, then flush atomically and wait for SOC-DEV-PS-ACK.
    • Handle defer_requests reports in apple_pmp_report_wait_ready() (returning -ENODEV immediately when the PMP node is not handed over, -EIO while starting/unacknowledged, 0 once running, flushed, requested, and acknowledged). Add pmp_defer_wait_ready_test KUnit test.
  3. drm/apple: dcp: wait for PMP display ack when apple,pmp-report is present (drivers/gpu/drm/apple/dcp.c)
    • Generalize dcp_ext_wait_pmp() so any DCP carrying apple,pmp-report waits for PMP acknowledgment and sets dcp->pmp_display_acked = true (lifting the provider-clock mode cap once the PMP scales the display clock). Preserves existing hard-fail semantics on T8122/J613 external DCPs; degrades gracefully on -ENODEV (0 ms delay, cap intact) or timeout on other DCPs.
  4. arm64: dts: apple: t8112: fix pmp_report entry indices to match soc-device (arch/arm64/boot/dts/apple/t8112.dtsi)
    • On T8112, soc-device records 2 and 3 are SOC-AON and SOC-REST, shifting EACC0..SCODEC by +2 (AGX=6, ANE0=7, ISP=8, DISP=9, DISPEXT=10, AVE=11, AVD=12, MSR=13, JPEG=14, SCODEC=15, DISPDFR=17). The ten entries pmp_report_gfx..pmp_report_scodec were off by -2 (0x4..0xd), causing DISP (9) and DISPEXT (10) to remain unrequested with the PMP running and making high-rate DCP mode sets time out. Fix all ten indices.
  5. arm64: dts: apple: t8112: enable PMP with CPU memory floor and display ack (arch/arm64/boot/dts/apple/t8112.dtsi)
    • Define APPLE_USE_PMP, link pmp_report to &pmp with apple,cpu-memory-floor = <0x21 2 0x25 4> (same binding format as t8122.dtsi and Documentation/devicetree/bindings/power/apple,t8140-pmp-report.yaml: class 0x21 top fabric level 2 of 3 states, class 0x25 top DCS level 4 of the 5 states already declared by apple,dcs-state-count = <5> in t8112.dtsi), and add apple,pmp-report to dcp (&pmp_report_disp0) and dcpext (&pmp_report_dispext).

Verification

Local Build & KUnit

  • checkpatch.pl --strict --git aurora/main..HEAD: 0 errors, 0 warnings, 0 checks across all 5 commits.
  • W=1 compile on drivers/pmdomain/apple/pmp-report.o and drivers/gpu/drm/apple/dcp.o: no new warnings.
  • kunit.py run --arch=arm64 --kunitconfig drivers/pmdomain/apple/.kunitconfig.apple-pmp-start --make_options LLVM=1: 33/33 passed (apple-pmp-start 15/15 incl. pmp_defer_wait_ready_test, apple-pmp-fast-die 4/4, apple-pmp-report 14/14).
  • kunit.py run --arch=arm64 --kunitconfig drivers/gpu/drm/apple/tests/display.kunitconfig --make_options LLVM=1: 188 passed, 1 skipped, 0 failed.

Hardware Row (Mac mini M2, J473, T8112, macOS 27.2 firmware)

Tested exact tree (098b53c0d52ab7, tree-identical to build 0dbd7ed7464a6d) on 7.3.0-aurora-m2pmp + trial Stage 2 (m2combo32 aura e019f3e6 + newly compiled t8112-j473-fw27.dtb), dual monitors (MSI USB-C DP-2 2560x1440 up to 280 Hz DSC + Acer HDMI HDMI-1 1920x1080 up to 180 Hz):

  • Boot & PMP: apple_pmp 23b500000.pmp: PMP firmware and endpoint ready; apple-pmp-report: PMP running (status 0x1), requests 0x600; PMP acknowledged the display request on both 231c00000.dcp and 271c00000.dcp; memory floor owner admitted: PACC0 update +0x10548; pmp-gfx, pmp-disp0, pmp-dispext all ON; SELinux Enforcing, 0 failed units, 0 AVC, 0 crashes, 0 timeouts.
  • Memory bandwidth (PMP on): single-thread mcpy P-core 38.6 GB/s / E-core 17.6 GB/s (x3: 38.6/17.6, 38.6/17.5, 38.6/17.5 GB/s). After 60 s idle, floor drops cleanly (dvfs_state=0x101), then re-raises to 38.6 / 17.4 GB/s (vs 9.9/6.0 GB/s without floor and 35.4/16.6 GB/s with PMP off).
  • Mode sweep & live display clock scaling:
    • MSI USB-C DP-2 2560x1440: 144 Hz (dvfs_state=0x101) -> 165 Hz (0x101) -> 180 Hz (0x101) -> 240 Hz (0x301) -> 280 Hz (0x301) -> 144 Hz (0x101), 0 timeouts, 0 crashes.
    • Acer HDMI-1 1920x1080: 120 Hz -> 180 Hz -> 120 Hz, 0 timeouts, 0 crashes.
  • DPMS off/on: both displays restored (connected_after=2), 0 timeouts, 0 crashes.
  • 30-minute soak (1800 s, 37 refresh-rate cycles across 165/240/280/144 Hz + periodic mcpy + mid-soak DPMS off/on): 0 PMP crashes, 0 DCP crashes, 0 mode-set timeouts, 125 floor raises / 124 drops (faulted=0), dvfs_state=0x324 under load at 240/280 Hz (matching DISP state 3 + SOC state 2 + DCS state 4), 0 AVC, 0 failed units, clean reboot back to saved kernel.

…ength

The T8112 PMP sends UPDATE_IOREG for three of its registered entries
shortly after it starts and expects CONFIRM_IOREG to carry the
registered entry length (8), as on T8132. Set confirm_ioreg_len on
HW_CFG_T8112 so the driver replies with each entry's registered length.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On T8112, pmp_report and its child entries (including apple,always-on
disp0) probe before apple_pmp starts the PMP firmware. Set
defer_requests on apple_pmp_offsets_t8112 so requests stay in the
shadow word until PMP-STATUS reports running, then flush together and
wait for SOC-DEV-PS-ACK.

Also handle defer_requests reports in apple_pmp_report_wait_ready() so
display drivers carrying apple,pmp-report can poll until the running
PMP has flushed deferred requests and acknowledged their display bit,
returning -ENODEV immediately when the PMP node was not handed over by
the boot loader. Add a KUnit case covering the deferred wait_ready
states.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…sent

Allow any DCP node carrying apple,pmp-report to wait for PMP
acknowledgment of its display request before starting the coprocessor
and set dcp->pmp_display_acked once acknowledged, lifting the
provider-clock mode limit when the PMP is running and scales the
display clock.

Preserve the existing hard-fail behavior for T8122/J613 external DCPs;
on other DCPs, return -EPROBE_DEFER if the report driver has not probed
yet, return 0 immediately on -ENODEV (PMP not handed over by the boot
loader), and warn while continuing with the provider-clock cap intact
if the acknowledgment times out.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…evice

In the T8112 PMP soc-device table, records 2 and 3 are SOC-AON and
SOC-REST, placing EACC0 at 4, PACC0 at 5, AGX at 6, ANE0 at 7, ISP at
8, DISP at 9, DISPEXT at 10, AVE at 11, AVD at 12, MSR at 13, JPEG at
14, SCODEC at 15, LTR at 16, and DISPDFR at 17 (0x11).

The pmp_report child nodes from pmp_report_gfx through
pmp_report_scodec were off by -2 (0x4..0xd instead of 0x6..0xf), so
enabling the PMP sent DISP and DISPEXT requests to ANE0 and ISP instead
of bits 9 and 10, causing high-rate DCP mode sets to time out while the
PMP treated the display blocks as off. Update all ten report entries to
their actual soc-device indices.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…y ack

Enable the PMP on T8112 (APPLE_USE_PMP), link pmp_report to the PMP
node with the demand-driven CPU memory floor (top DCS class 0x25 level
4, top fabric class 0x21 level 2), and point both dcp and dcpext at
their pmp_report entries via apple,pmp-report so each waits for PMP
display acknowledgment and lifts the provider-clock cap once the PMP is
scaling the display clock.

With the PMP running, the CPU memory floor restores full P/E-core DRAM
bandwidth and the PMP dynamically scales the display clock for
high-refresh external modes.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 1, 2026 13:38
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at 579e4a2d: not ready yet

Check Detail
CI at head no failing: DWC3/ATC
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head no no line with the head SHA 579e4a2d, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · T8112 (M2)

Areas: area:display, area:gpu, area:platform, area:power

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

DjDeveloperr
DjDeveloperr previously approved these changes Dec 1, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The T8112 report indices match the intended device entries. Startup defers requests until PMP is running, and display clock scaling is admitted only after both the request and its acknowledgement are visible. The J473 mode, bandwidth and soak row covers the proposed tree. Relevant hosted checks and a second T8112 board row are still pending.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 1, 2026
@DjDeveloperr
DjDeveloperr dismissed their stale review December 1, 2026 14:33

Withdrawing my approval after reproducing two host-test regressions at 098b53c. Both pass on the tested base 6f3b2a3. The graph extractor omits the new apple_pmp_report_defer_ready() helper. The supplier fixture also lacks defer_requests in its mock offsets. Please update both fixtures and verify the normal and mutation runs.

@github-actions github-actions Bot added the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 1, 2026
The T8112 PMP change made apple_pmp_report_wait_ready() call the new
apple_pmp_report_defer_ready() when the report's offsets set
defer_requests. Both T6030 host fixtures extract wait_ready verbatim and
stopped compiling:

- t6030-pmp-graph-tests: extract apple_pmp_report_defer_ready() as well
  (the fixture already models rep->defer and defer_requests).
- t6030-pmp-supplier-tests: add defer_requests to the mock offsets and a
  stub defer_ready() that fails the test if reached, since T6030 never
  defers requests.

Normal and mutation runs of both pass again.
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Fixed the two host-test regressions from the 14:33Z review in 579e4a2 (fixtures only, no driver change):

  • t6030-pmp-graph-tests now also extracts apple_pmp_report_defer_ready().
  • t6030-pmp-supplier-tests: defer_requests added to the mock offsets, plus a stub defer_ready() that fails the test if T6030 ever reaches the deferred path.

run-host-tests.py --only pmp: 24/24 pass, including the normal and mutation runs of both. The other red host tests (ave-recovery-old, brcmf-ps-nap-tests) fail the same way on main and are fixed by #3778. The J473 row and the 30-minute soak covered 098b53c; the delta since then is test-only. Ready for a re-review.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both T6030 PMP fixtures now pass on this head. I reran the graph and supplier suites with Clang, including both mutation runs. The update touches only the fixtures, so the J473 runtime evidence still applies to the driver changes. Hosted checks and the second T8112 hardware row remain open.

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) ci-failing A check failed at the PR head (bot) labels Dec 1, 2026
@RyanTheTide
RyanTheTide merged commit 134f409 into main Dec 1, 2026
17 of 18 checks passed
@RyanTheTide
RyanTheTide deleted the fix/t8112-pmp-display-floor branch December 1, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants