Repository navigation
pmdomain/arm64: apple: keep dcpext1's PMP entry on through s2idle (T6000) - #4237
Conversation
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>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
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_DTBSon 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 byapple,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#ifdefblock 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.
|
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.
|
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 notapple,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 addsapple,sleep-wakeup-pathfor PMP report entries (binding, and the driver makes such an entry active-wakeup, nothing else) and sets it onpmp_report_dispext1in 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-dispext1entry withoutapple,always-on(T6002 alsopmp-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_checkwas not run.Details
How it fails on main:
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.pmp-disp0andpmp-dispext0carryapple,always-on,pmp-dispext1does not (t600x-die0.dtsi).apple,always-onentry getsGENPD_FLAG_ACTIVE_WAKEUP(pmp-report.c).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). Forpmp-dispext1it 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-onon 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-pathonly 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):
find /sys/firmware/devicetree/base -path '*report@e*' -name 'apple,sleep-wakeup-path': 1 file70304c000.mux: Switched dpphy to dispext1,0-110,failed to validate DPTX,reconnect failedfor 28cc00000.dcp; 0 kernel warningsThe 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.