Repository navigation
Conversation
…itions Wire consumer PMC BWR and boost interface clear/restore into the direct MMIO display-domain transition helpers (dcp_s2r_domains_off() and dcp_s2r_domains_on()) in hardware power-domain order: - preflight PMC availability in dcp_s2r_suspend() and dcp_s2r_ext_suspend() before stopping firmware, so an unavailable provider or CONFIG_APPLE_PMC=n on a configured pipe refuses sleep cleanly instead of stranding a stopped firmware during refused-sleep recovery. - off: preflight PMC before touching DART/PMGR, lower CPU and FE, wait for FE off, clear PMC interface enables (recording s2r_pmc_off), then lower SYS and wait for CPU off. - on: raise SYS and wait for SYS on, restore PMC interface enables before raising FE and CPU (aborting before setting s2r_domains_up if restore fails), then raise FE and CPU. Treat -ENODEV (and -EOPNOTSUPP when CONFIG_APPLE_PMC is disabled on pipes with no configured PMC interface in DT) as an absent optional interface, while propagating -EOPNOTSUPP and all other errors for pipes with a configured or malformed PMC interface topology. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Clear dcp->dpms_powered_off in dcp_dpms_power_on() only when s2r_fw_down is already false or after dcp_s2r_display_on() succeeds, so a failed PMC interface restore or post-start boot/display-on failure leaves dpms_powered_off armed for the next unblank to retry instead of returning early while s2r_pmc_off and s2r_fw_down remain set. Unwind post-domain start failures via dcp_s2r_unwind_failed_start() in both dcp_s2r_display_on() and dcp_s2r_prewarm_work(), stopping secure port polling, detaching the RTKit mailbox, clearing CPU RUN, stopping DART streams, and powering down the display domains and PMC interface so the next retry starts from a clean stopped state. Also lower DISP_SYS if dcp_s2r_pmc_on() fails in dcp_s2r_domains_on(). Add a KUnit suite (apple-dcp-s2r-pmc) under CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST covering failed PMC restore, failed post-start boot handshake, and failed post-start display-on followed by clean retries. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Updated the PR body with the J713 (M4 Air, 27.2 firmware) hardware run at head |
There was a problem hiding this comment.
Verdict: HOLD at 4b09f069
Blockers:
- Targets non-
mainbase branchfeat/apple-pmc-consumer-interface-chain(#3297), which is still open. Full build/KUnit/host-tests CI has not run againstmain. Once #3297 lands onmain, retarget this PR tomainand run full CI for full review.
Checked: PR base branch (feat/apple-pmc-consumer-interface-chain), dependency PR #3297 status, CI status (readiness and pr-text only), no AI attribution, human Signed-off-by.
Evidence
- Base branch
feat/apple-pmc-consumer-interface-chaincorresponds to open PR #3297. - Because this PR does not target
main,apple-build,host-tests, and KUnit workflows have not run on4b09f069.
When wait_for_completion_timeout(&dcp->s2r_dart_done, ...) times out in dcp_s2r_display_on(), return -ETIMEDOUT instead of 0 so dcp_s2r_unwind_failed_start() powers the display domains and PMC interface back down and dcp_dpms_power_on() keeps dpms_powered_off and s2r_fw_down armed to retry on the next unblank. Route KUnit display_on hooks through dcp_s2r_power() with a test D572 timeout so apple-dcp-s2r-pmc exercises the completion timeout and retry path directly. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Addressed both review blockers on top of
Verified at head
Once |
|
@erikwb, please use this head for the next J313 and J713 DPMS and sleep smoke. The new head is ready for independent review and for hosted KUnit to run the failure case. |
The failed rollback now latches the terminal state and covers retry refusal in e21f17c.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approved at e21f17ce0577. The CPU timeout now latches s2r_start_stuck if rollback fails, so the next warm restart refuses before toggling PMC interfaces or booting the DCP. The new KUnit assertions cover both that retry refusal and a successful rollback leaving the latch clear. The exact-head display KUnit check passed. The refreshed display hardware row is still pending.
…er state On apple_pmc_interface_consumer_on(), apple_pmc_interface_consumer_set() wrote boost_enable before bwr_enable without restoring boost_enable if the BWR write failed, while leaving consumer_off set. Restore the prior boost_enable bit on BWR failure, and have apple_pmc_interface_consumer_check() verify that neither hardware bit remains set before reporting -EALREADY. Extend the apple-pmc KUnit suite to cover both clean boost rollback and stuck-boost failure reporting on consumer power-on. Signed-off-by: Erik Bourget <erik@ebourget.net>
…aths In dcp_s2r_domains_on(), do not lower DISP_SYS unconditionally when dcp_s2r_pmc_on() fails: check the PMC interface state first, try dcp_s2r_pmc_off() if it reports active, and keep DISP_SYS up with s2r_start_stuck latched if off state cannot be confirmed. Also check s2r_start_stuck at entry to dcp_s2r_ext_start(), dcp_s2r_ext_cycle(), dcp_s2r_refused_domains_off(), dcp_s2r_domains_off(), and dcp_s2r_domains_on() so neither external wake restarts nor refused-sleep cycles clear dcp->crashed or access display domains once latched. Update the apple-dcp-s2r-pmc KUnit test stub to model -EALREADY when s2r_pmc_off is set and add cases covering unconfirmed PMC restore failure, left-on rollback failure, and stuck external start/cycle paths. Signed-off-by: Erik Bourget <erik@ebourget.net>
When dcp_s2r_pmc_off() fails to clear BWR and rolling back boost also fails, apple_pmc_interface_consumer_check() returns -EIO while consumer_off remains latched and boost_enable is cleared. Leaving s2r_pmc_off false keeps DISP_SYS powered, but the next DPMS unblank must still call dcp_s2r_pmc_on() before raising DISP_FE or DISP_CPU. Track pending PMC restoration in s2r_pmc_restore separately from the confirmed hardware-off state in s2r_pmc_off, require dcp_s2r_pmc_on() to succeed whenever either flag is set before raising FE or CPU, and cover failed rollback followed by unblank in apple-dcp-s2r-pmc. Signed-off-by: Erik Bourget <erik@ebourget.net>
When dcp_s2r_pmc_off() fails and consumer state verification or restoration also fails, returning early skipped the DISP_CPU power-off poll. A subsequent unblank could then restore PMC and request DISP_CPU on before the CPU ever power-cycled. Keep DISP_SYS powered across PMC off failures, still poll DISP_CPU off, latch dcp_s2r_start_stuck() if that poll times out so later restarts are blocked, and add apple-dcp-s2r-pmc KUnit coverage where PMC restoration can succeed but DISP_CPU never reached off. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Pushed
Local checks at
Hardware / build status at
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approving at a37ced381725. I found no real defect. Most of my attention went to fbdf48f794c2..a37ced381725.
What I checked:
- PMC on rollback (
apple_pmc_interface_consumer_set()): if the BWR write fails, boost goes back to the value read under the same lock. If that rollback also fails,consumer_offstays set andapple_pmc_interface_consumer_state()reports-EIO, not-EALREADY, so nothing treats the pipe as confirmed off. The other users of the changed check (apple_pmgr_ps_consumer_check()and its callers iniomfb_m4.c) treat-EIOand-EALREADYthe same way ("can't gate"), so nothing changes for them. - Power-off failures (
dcp_s2r_domains_off()): I followed each PMC-off failure branch: clean rollback,-EALREADYwith restore ok or failed,-EIO, and other errors. Every one keeps DISP_SYS up and still waits for DISP_CPU to read off. Thes2r_pmc_off/s2r_pmc_restoresplit always leaves a state that the nextdcp_s2r_domains_on()either restores before raising FE/CPU or refuses. None of the branches raises FE or CPU without the interface restored. - Power-on failures (
dcp_s2r_domains_on()): a failed restore either turns the interface off before SYS goes down, or keeps SYS up and latches. s2r_start_stuck: ext start, ext cycle, the refused-sleep power-off and both domain paths now refuse beforecrashedis cleared. A later system sleep still takes the stopped-firmware path indcp_s2r_suspend()/dcp_s2r_ext_suspend(), so the latch doesn't hold sleep off.- Waits: every new wait is a 50 ms
readl_poll_timeout(), so nothing here can block suspend. - No PMC interface: this covers every SoC except T8132 in today's DTs, and builds with
CONFIG_APPLE_PMC=n. The check returns-ENODEVor-EOPNOTSUPP,pmc_presentstays false, and the PMC flags are never set.
Local checks, on the merge with main b3a5fda631b9 (merges cleanly, tree d32762f746c2), arm64, LLVM=1:
- W=1 on
dcp.o,pmc.oandpmgr-pwrstate.oin the apple-build config (defconfig + asahi.config, Rust off): 0 warnings. Also 0 warnings with every KUnit test off, and fordcp.owithCONFIG_APPLE_PMC=n. - arm64 KUnit build of dcp-display, dcp-topology, dcp-fabric and pmgr-pwrstate, plus
CONFIG_APPLE_PMC_KUNIT_TEST: it linksdcp_s2r_pmc_suite,apple_pmc_test_suiteandpmgr_ps_test_suite. W=1 on the same three objects with the tests built in: 0 warnings. These were built but not run, since there's no QEMU here. Your arm64 run (24/24 and 18/18) is the execution result. - checkpatch
--stricton the 12 commits: clean, apart from the known MAINTAINERS note on4b09f0691c2d.
Not blocking:
drivers/gpu/drm/apple/dcp.c:10729: the latch fires on any DISP_CPU-off timeout, not only after a PMC-off failure. On SoCs without the interface, a DPMS off where DISP_CPU takes more than 50 ms to read off now leaves the panel dark until the driver is rebound; main retried on the next unblank. That's a fair safety choice, but the commit subject reads as PMC-only, so please say so in the message.drivers/gpu/drm/apple/dcp.c:10670: when DISP_FE times out, the function still returns before the DISP_CPU poll, so that case doesn't get the same latch.
Still needed before merge: a hardware row at this head, or a patch-identical one, on T8132. J713 is the only board whose DT wires up these interfaces. The J713 row at 241b8646ccdf predates this push's dcp.c and pmc.c changes. The J313 composite row at this head covers T8103.
Main gained static-stub S2R tests (dcp_s2r_test.c) next to this branch's s2r_test_ops tests (dcp_s2r_pmc_test.c). Conflicts in dcp.c: - dcp_s2r_domains_on(): main's KUNIT_STATIC_STUB_REDIRECT stays the first statement, followed by this branch's s2r_start_stuck check. - Keep main's dcp_s2r_warm_rtkit_boot() and this branch's dcp_s2r_mailbox_off(), dcp_s2r_disp_streams_off() and dcp_s2r_unwind_failed_start(). - Include both dcp_s2r_test.c and dcp_s2r_pmc_test.c. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Merged Conflict: only
Nothing else changed. The PR's added and removed lines against main are the same as they were against its old base, and main's own changes come through unchanged. Local checks (arm64,
Still needed: hosted CI at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Independent review of the forward merge at 4ecdedc24ec7 (parents: the earlier head a37ced381725 and main 87c01c2c901d).
Verdict: MERGE. The merge keeps both sides intact, the branch still merges cleanly into today's main, and the build and style checks below came back clean apart from the noted pre-existing items. Exact-head hosted CI and the hardware rows are still owed before landing.
1. Merge correctness. I redid the merge myself and compared the result with 4ecdedc2:
git merge-tree --write-tree --merge-base=006f20f150fe a37ced381725 87c01c2c901d(006f20f150feis GitHub's merge base for the two parents) conflicts indrivers/gpu/drm/apple/dcp.conly. The local clone is shallow, so I passed the base explicitly.git diff-tree -r <that tree> 4ecdedc2: the only file that differs isdcp.c. Every other file equals a clean merge.- In
dcp.c, all three conflict blocks are resolved the way the notes say:dcp_s2r_domains_on()starts with main'sKUNIT_STATIC_STUB_REDIRECT, then the PR'ss2r_start_stuckcheck.- Main's
dcp_s2r_warm_rtkit_boot()is kept, followed by the PR'sdcp_s2r_mailbox_off(),dcp_s2r_disp_streams_off()anddcp_s2r_unwind_failed_start(). The brace that both sides shared now closes the last helper. dcp_s2r_test.canddcp_s2r_pmc_test.care both included.
- Each of these functions is defined exactly once. The two test files share no top-level names.
- Nothing was lost or reordered. For all five files the PR touches, the ordered list of added and removed lines is identical between
006f20f1..a37ced38and87c01c2c..4ecdedc2(thegit diff -U0+/- lines hash the same). The same holds the other way for main's changes in the four files both sides edited (006f20f1..87c01c2canda37ced38..4ecdedc2). Fordcp.cthat is 472 added and 33 removed lines on the PR side, and 1587 added and 217 removed on main's side. - The two sides still fit together:
- Main's
apple-dcp-s2rsuite stubsdcp_s2r_domains_on()anddcp_s2r_warm_rtkit_boot(). It never setss2r_test_opsors2r_start_stuck, so its three cases follow the same op sequence as before. - The PR's
s2r_test_opsbranch indcp_s2r_warm_restart()still returns before the newdcp_s2r_wake_darts()call. - The PR's failed-start unwind still undoes what
dcp_s2r_wake_darts()turns on. Ons2r_disp_dart_with_dcppipes,dcp_s2r_stop_streams()drains both DARTs. On the other pipes,dcp_s2r_disp_streams_off()drains the display DART.
- Main's
2. Current main. I built on main f4b229b300bb. None of its commits since 87c01c2c touch the PR's files, and git merge-tree --write-tree --merge-base=87c01c2c f4b229b3 4ecdedc2 is clean (tree 132800e301f6). Main moved to b47fc630ebd9 while the build ran. Its 38 further commits change 36 files: none of them is one of the PR's files, none is a header, and drivers/iommu/apple-dart.c changes no exported symbol or prototype that dcp.c calls. git merge-tree --write-tree --merge-base=87c01c2c b47fc630 4ecdedc2 is clean too (tree 9fbec8d79f99). The GitHub compare gives merge base 87c01c2c, with the PR 15 commits ahead and 50 behind.
3. Build (test merge 8030a19c = main f4b229b3 + 4ecdedc2, arm64, LLVM=1, clang, warm reflink of a stock aurora_defconfig output):
- The config came from
make aurora_defconfigand is byte-identical to a freshaurora_defconfigin an empty output directory. It hasDRM_APPLE=m,DRM_APPLE_DISPLAY_KUNIT_TEST=y(so both S2R test files are compiled intodcp.o),APPLE_PMC=yandKUNIT=m. make -j20 -k Image modulescompiled everything, including the rebuiltdcp.oandpmc.o. It then stopped at modpost on exactly one error:ERROR: modpost: drivers/gpu/drm/apple/appledrm.ko: symbol 'snd_pcm_lib_preallocate_free' undefined!. That error predates this PR. It comes from main'sdrivers/gpu/drm/apple/audio-legacy-test.c(from #3410;sound/core/pcm_memory.cdoes not export the symbol), and this PR touches neither file. modpost reports every undefined symbol in a single pass, so nothing else inappledrm.koor any other module is unresolved.make KBUILD_MODPOST_WARN=1 -j20 Image modules(that same error downgraded to a warning) finished with exit code 0. It producedvmlinux,Imageandappledrm.ko(vermagic7.3.0-rv3300-8030a19c). The other modpost lines are main's existing "missing MODULE_DESCRIPTION()" warnings on four unrelated test modules.make W=1 -j20 drivers/gpu/drm/apple/ drivers/pmdomain/apple/finished with exit code 0, 0 warnings and 0 errors. It recompiled 81 objects with the W=1 flags,dcp.oandpmc.oamong them. The 17 objects it left alone are 14.mod.ostubs, plusdcp-fabric-core.o,dcp-fabric-test.oandiomfb-state-test.o. Those three are built fromdrivers/gpu/drm/Makefile, not theapple/directory, and neither this PR nor the merge touches them.- KUnit did not run here (no QEMU on this host). The KUnit plan in hosted CI covers that.
4. checkpatch. scripts/checkpatch.pl --strict on git diff f4b229b3 8030a19c (the PR's net diff against main, 5 files, +1607/-39): 0 errors, 0 checks, 1 warning. The warning is the generic "does MAINTAINERS need updating" for the new dcp_s2r_pmc_test.c. The SPDX sub-check could not run on the build host (no ply module). I checked the new file's header by hand: // SPDX-License-Identifier: GPL-2.0-only.
Hardware. The merge changes no logic on either side. The PR's added and removed lines are the same as at a37ced381725. Still, the S2R path now runs main's dcp_s2r_wake_darts() and dcp_s2r_warm_rtkit_boot() together with the PR's PMC ordering and unwind. So the rows still owed in the PR body (J713 DPMS, s2idle and deep suspend, and J716c) should run at this exact head. They should not be carried over from a37ced381725 or the composites. One J313 DPMS and deep S2R pass is also useful, as an unaffected T8103 row for main's T8103 DART-wake change running alongside this PR.
Still needed: exact-head hosted CI (apple-build, host-tests and the KUnit plan were pending when I checked), those hardware rows, and an approval from an account that did not push this head.
Commands I ran (on the pc build host, partial clone with GIT_NO_LAZY_FETCH=1, builds through ~/bin/aurora-build with 20 threads):
git merge-tree --write-tree --merge-base=006f20f150fe a37ced381725 87c01c2c901d # conflict: dcp.c only
git diff-tree -r <merged tree> 4ecdedc24ec7 # only dcp.c differs
git diff -U0 006f20f1 a37ced38 / 87c01c2c 4ecdedc2 (and 006f20f1 87c01c2c / a37ced38 4ecdedc2), +/- lines hashed per file # all identical
git merge-tree --write-tree --merge-base=87c01c2c f4b229b3 4ecdedc2 # clean, 132800e301f6
git merge-tree --write-tree --merge-base=87c01c2c b47fc630 4ecdedc2 # clean, 9fbec8d79f99
make ARCH=arm64 LLVM=1 aurora_defconfig && make -j20 -k Image modules # only the known modpost error
make ... KBUILD_MODPOST_WARN=1 -j20 Image modules # rc 0, appledrm.ko built
make ... W=1 -j20 drivers/gpu/drm/apple/ drivers/pmdomain/apple/ # rc 0, 0 warnings, 0 errors
scripts/checkpatch.pl --strict <(git diff f4b229b3 8030a19c) # 0 errors, 1 warning, 0 checks
|
J773g 4ecdedc PASS (7.3.0-j773g-comp4-2856-3227 on main 1262f9e, boot_id=a2fdb8dc-5904-45ba-aca5-cd6391aa061a; DP-3 3840x2160 at boot, 4x DPMS off/on OK, 3x s2idle with DP-3 returning, mem refusal matches base [48ae00000.dcp errno=-16] with DP-3 restored; 0 stuck/latch/rollback, 0 DART faults, 0 WARN/Oops, 0 failed units) |
|
Local host CI at
|
What: Wire consumer PMC BWR/boost interface preflight, clear, and restore into direct-MMIO display-domain S2R transitions (
dcp_s2r_domains_{off,on}()) in hardware power-domain order (CPU -> FE -> PMC -> SYSon off;SYS -> PMC -> FE -> CPUon resume), roll back boost enables and verify hardware enable bits on PMC restore failures, track pending PMC restoration separately from confirmed hardware-off state, keepDISP_SYSup and still pollDISP_CPUoff across PMC-off failures (latchings2r_start_stuckon timeout), keepdpms_powered_offarmed until restart succeeds, drain both display and DCP DARTs before lowering domains, and latchs2r_start_stuckacross both internal and external S2R paths (bde2a1d9743f..a37ced381725); builds on#3297(now onmain).Tested: At head
a37ced381725: localLLVM=1 W=1build ofdrivers/gpu/drm/apple/dcp.o(0warnings) anddrivers/pmdomain/apple/pmc.o(0new warnings), arm64 QEMU KUnitdisplay.kunitconfig(204passed,1skipped;apple-dcp-s2r-pmc24/24),apple-pmc(18/18),checkpatch.pl --strict --git e21f17ce0577..HEAD(0errors,0warnings,0checks), andgit merge-tree --write-treeclean againstorigin/main(8616760ed646->922512a6262c); at ancestor3124f5f5237e(prior toa37ced381725ondcp.c/dcp_s2r_pmc_test.c):topology.kunitconfig(210passed,1skipped),.kunitconfig.pmgr-pwrstate(30/30), andtools/asahi/run-host-tests.py(837/838passed;apple-dcp84/99ok with the15pre-existing unrelated TAP failures); composite hardware smoke ata37ced381725onJ313(M1 Air,T8103, unaffected smoke row) in Evidence, plus clean arm64 builds forJ713(25e08d2ee142composite overorigin/maind3de772ac0c1,352 s) andJ716c(standalonea37ced381725);J713andJ716chardware runs not yet completed (J713currently off-network;J716csession stopped on an earlier composite trial before booting the standalone#3300kernel).Risk: two-way door · Apple SoCs using direct-MMIO display-domain S2R/DPMS power-gating (
dcp_s2r_domains_{off,on}()) and consumer-switched PMC display-pipe interfaces (apple_pmc_interface_consumer_*()).Not yet: exact-head
a37ced381725hosted CI,J713(M4 Air,T8132,27.2, currently off-network; composite25e08d2ee142built cleanly) hardware pass (4+4DPMS,s2idle, deep suspend,disp/pmc-interfacedomain checks), andJ716c(M5 Max,T6050) hardware pass (standalonea37ced381725built cleanly, not booted after theJ716ccomposite conflicted with#3398indcp_s2r_domains_off()and stopped ons2idle); exact-head J713 hardware exercise of the external-pipe consumer chain and of the power-on rollback / display DART drain unwind paths (needs a tree carrying the dock-display stack, and a failing power-on, which the lab does not produce on demand);26.6.2externaliomfb_m4.c(requires a26.6.2-firmware M4; lab J713 runs27.2); external non-lab Macs.Details
#3297(merged tomainin645b086d9989). Targetsmain;git merge-tree --write-tree origin/main a37ced381725is clean (922512a6262c6c3b177b252a1e8a6bc0d25df135).dcp_s2r_pmc_preflight()indcp_s2r_suspend()anddcp_s2r_ext_suspend()before stopping firmware or disrupting presentation, so an unavailable PMC provider orCONFIG_APPLE_PMC=non a configured pipe refuses cleanly instead of stranding a stopped firmware during refused-sleep recovery.6a84c1d95460):dcp_s2r_domains_off(): preflights PMC before darkening DART or lowering PMGR, lowersDISP_CPUandDISP_FE, pollsDISP_FEoff, clears PMC interface enables (recordings2r_pmc_off), then lowersDISP_SYSand pollsDISP_CPUoff.dcp_s2r_domains_on(): raisesDISP_SYSand pollsDISP_SYSon whens2r_pmc_offis set, restores PMC interface enables before raisingDISP_FEandDISP_CPU(aborting before settings2r_domains_upif restore fails), then raisesDISP_FEandDISP_CPU.4b09f0691c2d,597803b9d48b,bde2a1d9743f,f29b4f2d9f48):dcp_dpms_power_on()keepsdpms_powered_offarmed whens2r_fw_downis true untildcp_s2r_display_on()succeeds.dcp_s2r_display_on()returns-ETIMEDOUTwhen D572 completion times out, unwinding throughdcp_s2r_unwind_failed_start()so the next unblank retries cleanly.dcp_s2r_unwind_failed_start()drains the display DART (dcp_s2r_disp_streams_off()) beforedcp_s2r_stop_streams()anddcp_s2r_domains_off(), and latchess2r_start_stuckwithcrashed = trueif either drain or domain power-off fails sodcp_s2r_warm_restart()refuses to restart over domains left powered on.b43e08447acd,241b8646ccdf,e21f17ce0577,fbdf48f794c2,224e82ed0a8f,3124f5f5237e,a37ced381725):DISP_CPUtimes out indcp_s2r_domains_on(),dcp_s2r_domains_on_rollback()lowers the PMC word,DISP_CPU, andDISP_FE, turns off any PMC interface raised during that power-on, lowersDISP_SYSonly if the PMC interface is off or absent (keepingDISP_SYSup if an existing PMC interface remains on), and pollsDISP_CPUoff. If rollback fails,dcp_s2r_domains_on()latchesdcp_s2r_start_stuck().apple_pmc_interface_consumer_set()restores the priorboost_enablebit if writingbwr_enablefails on power-on, andapple_pmc_interface_consumer_check()checks both hardware enable bits before returning-EALREADY.dcp_s2r_pmc_on()fails indcp_s2r_domains_on(),dcp_s2r_domains_on()checks the PMC interface state (tryingdcp_s2r_pmc_off()if active) and keepsDISP_SYSup while latchingdcp_s2r_start_stuck()unless the interface is confirmed off or absent.dcp_s2r_ext_start(),dcp_s2r_ext_cycle(),dcp_s2r_refused_domains_off(),dcp_s2r_domains_off(), anddcp_s2r_domains_on()checks2r_start_stuckbefore clearingcrashedor touching hardware.CONFIG_APPLE_PMC=nfallback: Tracks confirmed hardware-off state (s2r_pmc_off) separately from pending PMC restoration (s2r_pmc_restore). Ifapple_pmc_interface_consumer_off()fails after loweringDISP_CPU/DISP_FE, checks and restores PMC on-EALREADY; if clearing BWR and rolling back boost both fail (-EIOcheck), keepss2r_pmc_offclear (leavingDISP_SYSup) while settings2r_pmc_restoreso the nextdcp_s2r_domains_on()must successfully restore PMC before raisingDISP_FEorDISP_CPU. Across alldcp_s2r_pmc_off()failures (including failed restoration or-EIOstate check),dcp_s2r_domains_off()keepsDISP_SYSup, still pollsDISP_CPUoff, and latchesdcp_s2r_start_stuck()if that poll times out so a later unblank cannot restore PMC and requestDISP_CPUon before the CPU has power-cycled. Treats-ENODEV(and-EOPNOTSUPPwith no configured DT PMC interface) as an absent optional interface.git revert -m 1 <merge-commit>onmain; kernel driver and KUnit changes only.Evidence
a37ced381725:./scripts/checkpatch.pl --strict --git e21f17ce05770d3b685c02a8e8468c147958a4b3..HEAD:0errors,0warnings,0checks acrossfbdf48f794c2(148lines),224e82ed0a8f(213lines),3124f5f5237e(241lines), anda37ced381725(177lines).git merge-tree --write-tree origin/main HEAD(8616760ed646): clean (922512a6262c6c3b177b252a1e8a6bc0d25df135).make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/dcp.o drivers/pmdomain/apple/pmc.o(defconfig+asahi.config,CONFIG_RUSTdisabled locally):0errors (dcp.o0warnings;pmc.o0new warnings,14pre-existing kernel-doc warnings onapple_pmc_domain)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig:Ran 205 tests: passed: 204, skipped: 1(apple-dcp-s2r-pmc24/24passed, covering DPMS retry, D572 timeout, display DART drain,s2r_start_stuck, prewarm unwind, CPU timeout rollback, PMC restore failure SYS retention/latch, stuck external start/cycle refusal, faileddomains_offrollback followed by unblank restore/blocking, andDISP_CPUoff timeout on PMC-off failure blocking restart;1skippedapple_g17_rx_util_min_test, needsCONFIG_UCLAMP_TASK)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1(CONFIG_APPLE_PMC=y,CONFIG_APPLE_PMC_KUNIT_TEST=y):Ran 18 tests: passed: 18(apple-pmc18/18passed, includingapple_pmc_test_interface_consumer_on_stuck).3124f5f5237e(prior toa37ced381725ondcp.c/dcp_s2r_pmc_test.c):./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig:Ran 211 tests: passed: 210, skipped: 1(1skippedapple_g17_rx_util_min_test, needsCONFIG_UCLAMP_TASK)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/pmdomain/apple/.kunitconfig.pmgr-pwrstate:Ran 30 tests: passed: 30(apple-pmgr-pwrstate30/30passed).python3 tools/asahi/run-host-tests.py:837/838passed (apple-dcp84/99ok with the15pre-existing unrelated TAP failures).a37ced381725):M1 Air,T8103, G13G, firmware27.2, default cmdline, one-shot Stage 2 + GRUB): PASS (unaffected smoke row:T8103display pipes use no PMC interface) in composite807c3bbf2263(origin/maind3de772ac0c1+#3507,#3332,#3850,#3359,#3334+#3410,#3300a37ced381725,#3289): clean boot (0Oops/BUG/WARNING/SError/Call trace;err+lines subset of default kernel;speakerguardd-v2-switchtest.servicefailed identically on a separate#3321build without#3359, not attributed to#3300),>= 7internaleDP-1DPMS off/on cycles (backlight 0 -> 130, plusDP-2DPMS when docked), and3/3docked deep S2R PASS (rtcwake -d /dev/rtc1 -m mem -s 20,suspend_statsfail 0, 16 MB RAM integrity PASS, pre/post-sleepcompute-checkandrender-checkPASS; software-undockeds2idlehung and is tracked under#3334).M4 Air,T8132,27.2firmware): composite25e08d2ee142(origin/maind3de772ac0c1+#3717,#3273,#3289,#3300a37ced381725,#3359,#3409) built cleanly (kb run -p linux-j713,352 s, exit0,CONFIG_DRM_APPLE_DCP_T8132=y); hardware pass not run whileJ713is off-network.M5 Max,T6050,27.2firmware): standalone#3300(a37ced381725) built cleanly (kb run -p linux-j716c), not yet booted (excluded from theJ716ccomposite due to a six-hunkdcp_s2r_domains_off()merge conflict with#3398, and theJ716cpass stopped on the composite'ss2idlenon-wake before booting the standalone build).e21f17ce0577:Apple build and KUnit(apple-build,KUnit plan,KUnit dcp-fabric dcp-topology dcp-display): PASS (https://github.com/aurora-silicon/linux/actions/runs/46799385083).Host tests(host-tests): PASS (https://github.com/aurora-silicon/linux/actions/runs/46799385403).pr-textandpr-readiness: PASS.241b8646ccdf, composite with#32970378182e01b8, prior toe21f17ce0577..a37ced381725): J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line): Linux 7.3.0 built from429e7e15f122with0378182e01b8and241b8646ccdf(plus five other open PR heads) merged cleanly, one-shot Stage 2 with that tree's devicetree: boots with0failed units and0AppArmor denials; 4 internal-panel DPMS off/on cycles (each off returnsdpmsStatusfalse, each on re-initialises the DCP firmware and returns true), a 20 ss2idlecycle (PM: suspend entry (s2idle)toPM: suspend exit,suspend_statsfail0), a 25 s deep suspend/resume (PM: suspend entry (deep)toPM: suspend exit, no reset,fail0) and 4 more DPMS cycles after resume, withisp,vencandavddomainsoff-0anddispext*/pmc-dispext*-interfacedomainsonafterwards. The external display processors did not probe in this build (-ENODEV, "no IOMMU domain";maindoes not carry the dock-display stack, and that stack conflicts with these two PRs), so the external-pipe consumer chain (dispext{0,1}_cpu -> _fe -> pmc-dispext{0,1}-interface) and the failure paths (power-on rollback, display DART drain unwind,s2r_start_stuck) were not exercised on hardware; those are covered by KUnit only.4b09f0691c2d(prior to597803b9d48b..a37ced381725and#3307merge):27.2firmware, default cmdline +panic=10, candidate37edba02c535): clean boot (0failed units,0AppArmor denials, same 3errlines as default), 3+3eDP-1DPMS off/on cycles before and after deep sleep, 20 ss2idlePASS (PM: suspend exit), and full hardwaredeepsleep resume PASS (no reset; allisp,venc, andavd_sysdomainsoff-0,dispext*anddisp_*on).3840x2160@120external display ondcpext, default cmdline, default Stage 21.0.0b17-gf5ddfff2, fleet candidate5509a254a6bd): boots cleanly, 3 DPMS off/on cycles ofeDP-1and external output, 2 deep sleeps ands2idleunaffected,0failed units,0AppArmor denials (unaffected row: T8103 display pipes use no PMC interface; one earlier full run hung ins2idleand did not reproduce on later runs or without#3329/#3332).3e4078f656d5): boots cleanly to SDDM/Hyprland (eDP-13456x2234@120), Borealis GPU (7,940/7,940dEQP-VK.ssbo.*Pass,0GPU faults),2xDPMS off/on cycles,0new failed units,0LSM denials,0new kernel errors — unaffected.6a84c1d95460(j713-dcpext/air-dcpext-2727a8022a6d24d+#32972b1bab104938+#33006a84c1d95460+#3307eab8b5157340+#330805d728d91d68):286e00000.dcpand48ae00000.dcppowered domains off in 1 ms, completedpm_test=devicesdeep suspend/resume and refused-sleep power-cycle recovery, and re-gated 5 s after resume with0errors/warnings.