Skip to content

pmdomain/arm64: apple: keep dcpext1's PMP entry on through s2idle (T6000) - #4237

Merged
DjDeveloperr merged 3 commits into
aurora-silicon:mainfrom
Ante042:j314s-dcpext1-s2idle-power
Dec 4, 2026
Merged

DjDeveloperr merged 3 commits into
aurora-silicon:mainfrom
Ante042:j314s-dcpext1-s2idle-power

Conversation

@Ante042

@Ante042 Ante042 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

What: On the M1 Pro MacBook Pros (J314s, J316s) dcpext1's power domain is its PMP report entry pmp-dispext1, which, unlike disp0's and dispext0's, is not apple,always-on. The DCP puts itself on the wakeup path for s2idle with its firmware running, but genpd keeps only an active-wakeup domain on for that, so the entry and dispext1's power states go off in the noirq phase under the running firmware. This adds apple,sleep-wakeup-path for PMP report entries (binding, and the driver makes such an entry active-wakeup, nothing else) and sets it on pmp_report_dispext1 in t6000.dtsi. For #3718 (the "dcpext1 not recovering after s2idle" part).
Tested: J314s M1 Pro, main 24970e1 with this PR and three other small PRs (#2835, #4235, #4236) at 0a274fa, ASUS ROG monitor on USB-C (on dcpext1: "Switched dpphy to dispext1,0"), HDMI monitor and an empty USB-C dock attached: live DT carries the property, 3 of 3 s2idle with the USB-C monitor connected after each, 0 DPTX / -110 / reconnect errors for 28cc00000.dcp, 0 kernel warnings. On the T6000 deep sleep series (where every s2idle and every refused sleep left dcpext1 unable to park at the next deep sleep) this fix took it to 8 of 8 deep sleeps after an s2idle and a dry run in the same boot.
Risk: Two-way door (a revert undoes it; the new DT property is optional). It selects itself on the 2 boards whose DT sets the property, J314s and J316s (both from t6000.dtsi); only the J314s has run it. On both it changes s2idle: dcpext1's PMP entry and the dispext1 power states stay on through s2idle while its firmware runs, as dispext0's already do, so s2idle keeps one more display block powered. The driver line does nothing for an entry without the property, so no other Mac's PMP report changes.
Not yet: A row with main's DT on the same kernel tonight (the A side); the s2idle power draw with and without; a J316s row. T6001 and T6002 (J314c, J316c, J375c, J375d) have the same pmp-dispext1 entry without apple,always-on (T6002 also pmp-dispext1_die1), and #3360 traces a J316c whose dcpext1 stopped answering after s2idle; this PR does not change them and nothing has run there. make dt_binding_check was not run.

Details

How it fails on main:

  1. J314s and J316s build with APPLE_USE_PMP (t6000-j314s.dts, t6000-j316s.dts), so each DCP's power domain is its PMP report entry: dcpext1 (28cc00000.dcp) -> pmp-dispext1.
  2. pmp-disp0 and pmp-dispext0 carry apple,always-on, pmp-dispext1 does not (t600x-die0.dtsi).
  3. Only an apple,always-on entry gets GENPD_FLAG_ACTIVE_WAKEUP (pmp-report.c).
  4. dcp_platform_suspend() puts the DCP on the wakeup path with its firmware running, and genpd keeps the domain on for that only when it is active-wakeup (pmdomain/core.c). For pmp-dispext1 it is not, so genpd powers the entry off in the noirq phase, the PMP request is withdrawn and the dispext1 power states above it go off too. The firmware loses its power without the driver or RTKit seeing it, and after the resume the driver talks to a coprocessor that was reset under it.

That matches what #3718 reports for dcpext1: after an s2idle resume an external display that gets a pipeline on dcpext1 stays dark, replugging does not help, a display on dcpext0 after the same resume works. The routing to dcpext1 during the HDMI hold after resume is not touched here.

Why a new property and not apple,always-on on the entry: always-on also seeds the entry's request bit when the PMP starts and requests it at probe, which changes what the PMP is started with. apple,sleep-wakeup-path only makes the entry active-wakeup, the same thing the property already means on a PMGR power state (apple,pmgr-pwrstate.yaml, pmgr-pwrstate.c). Why not in the DCP driver: the DCP already sets the wakeup path; whether genpd honours it is the domain's flag, which only the provider sets.

#3360 (dptxep HDMI retries) is a different change for what may be the same stall on a J316c; both can land.

Evidence

Build (LLVM=1, W=1, arm64), each commit on its own: rc=0, 0 warnings. checkpatch --strict: 0 errors, 0 warnings, 0 checks on all three.

Rows on the J314s, kernel built from 0a274fa (main 24970e1 + #2835, #4235, #4236 and this PR):

DT find /sys/firmware/devicetree/base -path '*report@e*' -name 'apple,sleep-wakeup-path': 1 file
USB-C monitor's DCP 70304c000.mux: Switched dpphy to dispext1,0
3 s2idle, rtcwake 30 s 3 of 3 exits; DP-1, eDP-1, HDMI-A-1 connected after each; 0 lines matching -110, failed to validate DPTX, reconnect failed for 28cc00000.dcp; 0 kernel warnings

The deep sleep series for the J314s carries these three commits first. On it, before the fix, dcpext1 failed to park at the first deep sleep after any s2idle or refused sleep (link sleep timed out, IOP IDLE failed); with it: deep, s2idle, deep, dry run, deep in one boot, all parked and restarted, then 8 of 8 further deep sleeps, 0 warnings.

A display coprocessor whose power domain is a PMP report entry keeps
its firmware running through s2idle and puts itself on the wakeup path
for it. Let the entry say so, as apple,sleep-wakeup-path says it for a
PMGR power state, so that the entry and the power states above it stay
on while the firmware runs.

Signed-off-by: Andreas Fernandez <andreas.fernandez@hotmail.com>
genpd keeps a domain on through system sleep for a device on the
wakeup path only if the domain is active-wakeup, and only
apple,always-on entries were. An entry without it is powered off in
the noirq phase although its consumer asked to stay powered: the
request is withdrawn and the PMGR states above it go off under a
firmware that still runs.

Make an entry with apple,sleep-wakeup-path active-wakeup too. Nothing
else changes for it: it is not seeded at the PMP start and not
requested at probe.

Signed-off-by: Andreas Fernandez <andreas.fernandez@hotmail.com>
With APPLE_USE_PMP (J314s, J316s) dcpext1 sits in the pmp-dispext1
report entry, which unlike disp0's and dispext0's is not always-on. Its
DCP stays on the wakeup path through s2idle, with its firmware running,
but genpd powered the entry and dispext1's power states off in the
noirq phase all the same. The firmware lost its power unseen, and the
next deep sleep could not park it: link sleep timed out, IOP IDLE
failed, and the block went down with it for the rest of the boot.

Mark the entry apple,sleep-wakeup-path. dcpext1 then goes through every
sleep as dcpext0 does.

Signed-off-by: Andreas Fernandez <andreas.fernandez@hotmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-03T22:01:02.565203Z
We couldn’t complete this review. Comment @codex review to try again.
85e09a4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Merge readiness at 85e09a42: ready to merge

Check Detail
CI at head ok 7 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 85e09a42
Conflicts ok none
PR text ok Risk: two-way · (a revert undoes it; the new DT property is optional). It selects itself on the 2 boards whose DT sets the property, J314s and J316s (both from t6000.dtsi); only the J314s has run it. On both it changes s2idle: dcpext1's PMP entry and the dispext1 power states stay on through s2idle while its firmware runs, as dispext0's already do, so s2idle keeps one more display block powered. The driver line does nothing for an entry without the property, so no other Mac's PMP report changes.

Areas: area:platform, area:power
Merge: gh pr merge 4237 --merge (Owners and Core through the bypass: add --admin).

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

@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.

Approve. The code at 85e09a4 is right. The only thing merge still waits for is a hardware row at this exact head (below).

What I checked:

  • The genpd reasoning holds. When dcpext1's firmware keeps running through s2idle, dcp_platform_suspend() puts the DCP on the wakeup path (device_set_wakeup_path()). genpd_finish_suspend() leaves a domain alone for such a device only if the domain has GENPD_FLAG_ACTIVE_WAKEUP. pmp-dispext1 didn't have it, so genpd counted dcpext1 as suspended, powered the entry off in the noirq phase, and ps_dispext1_cpu0 followed. With the flag, the entry's suspended count never reaches its device count, so the entry stays on, and its parent stays on because it still has a powered subdomain. dcpext1 has a single power domain, so it is attached to the entry directly, with no virtual device in between.
  • The driver line sets the flag only when the property is present. Nothing else about the entry changes: it is not seeded at the PMP start, it is not requested at probe, and the noirq release path is untouched (pmp-dispext1 has no apple,release-for-sleep). When the DCP is not on the wakeup path, genpd powers the entry off as before.
  • Only report@e (pmp-dispext1) in t6000-j314s and t6000-j316s gets the property. No other DT sets apple,sleep-wakeup-path on a PMP report entry; the other users (t600x, t604x and t8132 pmgr) are PMGR power states. So no other Mac changes.
  • Org rules: no runtime switch or parameter, no magic constant, and no SoC or board check in the code, because a DT property selects the behaviour. The property is OS policy, not a value the ADT carries, and it means the same thing it already means on a PMGR power state.

Checks I ran, comparing main a0e5cf1 with main plus these three commits. The PR's files haven't changed on main since your base 24970e1, and I checked the patched files against this head's blobs:

  • dt_binding_check DT_SCHEMA_FILES=power/apple,t8140-pmp-report.yaml (dtschema 2026.9, yamllint): passes, 0 warnings.
  • CHECK_DTBS on t6000-j314s.dtb and t6000-j316s.dtb: 71 warning lines at base and 71 at head; none new, none gone. The decompiled DTBs differ only by apple,sleep-wakeup-path; in report@e.
    The hosted dt-checks job was skipped on this PR, so these are local runs.

Hardware: your rows ran on 0a274fa, which also carries #2835, #4235 and #4236. #2835 changes how a DP-alt port is routed to dcpext1, which is the path these rows exercise, so they don't isolate this PR. Please post one J314s row on a kernel built from 85e09a4 alone (or from this PR merged on current main):

  • a USB-C display on dcpext1 ("Switched dpphy to dispext1,0");
  • at least 3 s2idle cycles, with the display back after each;
  • 0 -110, DPTX or reconnect errors for 28cc00000.dcp, and 0 kernel warnings.
    Put the head SHA in the row line so the readiness check picks it up. The A side you planned (same kernel, main's DT) is worth adding, because it shows the property is what fixes it. A J316s row would be good to have, but merge doesn't need it: J316s uses the same t6000.dtsi node and the same driver path.

Two small things, no change needed:

  • The &pmp_report_dispext1 override sits outside #ifdef APPLE_USE_PMP, but its comment ties it to APPLE_USE_PMP. Both T6000 boards define it, so the DTBs come out the same either way. Moving it into the #ifdef block below would match the comment.
  • About "Not yet": no T6001 or T6002 board defines APPLE_USE_PMP. On J314c, J316c, J375c and J375d, dcpext1 sits on ps_dispext1_cpu0 directly and pmp-dispext1 has no consumer. If #3360's J316c stall is the same genpd problem, the fix belongs on the PMGR state, not on this entry.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 3, 2026
@Ante042

Ante042 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

85e09a4, J314s / T6000 (MacBook Pro 14", M1 Pro): pass. USB-C display on dcpext1 ("Switched dpphy to dispext1,0"), 3 s2idle cycles with the display back after each, 0 -110/DPTX/reconnect errors for 28cc00000.dcp, 0 kernel warnings.

  • Build: 85e09a4 (3 commits on main 24970e1) plus one local commit that sets the GPU DRM driver name to "asahi" so the distro's Mesa loads. Command line adds apple_sleep.deep=1 panic=30; mem_sleep offered only s2idle; CONFIG_DRM_APPLE_DEBUG off.
  • Cycles: 3 suspend entries and 3 exits in the log; after each, DP-1, eDP-1 and HDMI-A-1 were connected and a camera frame showed the picture back on the USB-C display. In cycles 2 and 3 one camera frame (frames 6 s apart) showed the USB-C and the HDMI display dark, and the next frame had both back; cause not checked.
  • 28cc00000.dcp: 0 lines with -110, "failed to validate DPTX" or "reconnect failed" in the boot log and the full run log. Its firmware prints "EDT ERROR: getClockFrequency" and "pmu ram read error" at boot and after each wake.
  • Kernel warnings: 0 at the start and the end, and failed units: only speakersafetyd.service. The display firmware's syslog (38bc00000.dcp, not the kernel) has 7 "WARNING - type mismatch" lines across both logs.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 4, 2026
@DjDeveloperr
DjDeveloperr merged commit 4315aae into aurora-silicon:main Dec 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform Area from CODEOWNERS (bot) area:power Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants