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 <[email protected]>
|
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 <[email protected]>
|
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 <[email protected]>
|
Addressed both review blockers on top of
Verified at head
Once |
There was a problem hiding this comment.
Verdict: HOLD at 597803b9
Blockers:
- Base branch &
mainconflict: Still targets open non-mainbase branchfeat/apple-pmc-consumer-interface-chain(#3297), and conflicts withorigin/mainindrivers/gpu/drm/apple/dcp.c(due to merged#3307); retarget tomainand resolve the conflict once#3297lands. - Full CI & exact-head J713 hardware row: Full hosted CI (
apple-build,kunit,host-tests) has not run againstmain, and the J713 (27.2) hardware rerun is still owed once#3297lands and#3307is merged (as noted in**Not yet:**).
Checked:
- Audited commit
597803b9(drivers/gpu/drm/apple/dcp.c,drivers/gpu/drm/apple/dcp-internal.h,drivers/gpu/drm/apple/dcp_s2r_pmc_test.c); zero code blockers found. - Confirmed
dcp_s2r_display_on()now setsret = -ETIMEDOUTwhenwait_for_completion_timeout(&dcp->s2r_dart_done, ...)expires with!completion_done(&dcp->s2r_dart_done), ensuringdcp_s2r_unwind_failed_start()stops the coprocessor/domains/PMC interface and leavesdpms_powered_offands2r_fw_downarmed for retry on the next unblank. - Confirmed routing the KUnit
display_onhook throughdcp_s2r_power()only interceptson == true, preservingdcp_s2r_power(dcp, false, ...), and the newdcp_s2r_pmc_dpms_retry_after_d572_timeouttest covers timeout unwind and second-unblank recovery (5/5apple-dcp-s2r-pmc,172displayKUnit,208topologyKUnit). - Confirmed the PR description clearly labels the three prior
4b09f0691c2druns as combined-build ancestor results and documents**Revert:**.
Evidence
drivers/gpu/drm/apple/dcp.c:dcp_s2r_d572_timeout_ms()overrides the timeout only underCONFIG_DRM_APPLE_DISPLAY_KUNIT_TESTwhens2r_test_ops->d572_timeout_msis non-zero;dcp_s2r_display_on()checks!wait_for_completion_timeout(...) && !completion_done(&dcp->s2r_dart_done)and setsret = -ETIMEDOUTbefore falling through toout:unwind.drivers/gpu/drm/apple/dcp_s2r_pmc_test.c:dcp_s2r_pmc_dpms_retry_after_d572_timeoutverifiess2r_active == false,dpms_powered_off == true,s2r_fw_down == true,s2r_pmc_off == true,s2r_domains_up == false,crashed == true,presentation_paused == true, and PS regs off after timeout, followed by clean recovery on seconddcp_dpms_power_on().
…s2r-pmc-interface Signed-off-by: Erik Bourget <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD — merge of #3297 clean, awaiting #3297 merge, retarget to main, full CI, and J713 rerun at 379d97e8fb8c
Blockers:
- Still targets open non-
mainbase branchfeat/apple-pmc-consumer-interface-chain(#3297); once#3297merges tomain, retarget this PR tomain(and resolve the#3307conflict indcp.c). - Full hosted CI (
apple-build,kunit,host-tests) againstmainand the exact-head J713 (27.2) hardware rerun remain open once#3297lands.
Checked:
- Merge
379d97e8fb8cpulls#3297's2617735d5df6updates cleanly into#3300with no unintended changes todrivers/gpu/drm/apple/dcp.c,dcp-internal.h, ordcp_s2r_pmc_test.c(MERGEABLEonfeat/apple-pmc-consumer-interface-chain).
Evidence
- Verified delta
597803b9d48b...379d97e8fb8ccontains only the#3297pmgr-pwrstatecommits;#3300's owndcp.c/ KUnit diff is unchanged from597803b9d48b.
…e-chain' into feat/dcp-s2r-pmc-interface Conflicts: drivers/gpu/drm/apple/dcp.c dcp_s2r_display_on(): keep the base's D572 handling (s2r_dart_err, dcp_s2r_dart_end() before the completion check) and this branch's unwind: a set_power_state(1) failure, a D572 timeout and a DART stream error all end in dcp_s2r_unwind_failed_start(). dcp_s2r_prewarm_work(): use dcp_s2r_unwind_failed_start(), which now follows the base's rule: the domains are powered off only once the display DART streams have stopped; a failed stop, or a failed power-off, marks the DCP crashed and leaves them up. dcp_s2r_domains_off(): keep only the base's s2r_domains_up clear, after the display DART has gone dark, not this branch's earlier one. The KUnit fixture initializes s2r_dart_lock and channels_idle_wq, which the base now uses, and stops the streams through a new stop_streams test hook, and turns the mailbox off through another; new cases check that a failed stream stop leaves the domains and the PMC interface up, and that the resume's start marks the DCP crashed when its unwind cannot stop the streams or lower the domains. Signed-off-by: Erik Bourget <[email protected]>
D572 can turn the display DART's streams on before set_power_state(1) times out, or before another step of the start fails. Where that DART is not stopped with the DCP's (s2r_disp_dart_with_dcp unset), dcp_s2r_stop_streams() leaves it to the firmware's next D572, and the unwind has stopped that firmware: the domains would then go down under a DART still streaming, and power_dark() leaves the stream enables as they are. Drain the display DART first in dcp_s2r_unwind_failed_start(), then the DCP's, and lower the domains only after both drains succeed; a failed drain marks the DCP crashed and leaves them up. Signed-off-by: Erik Bourget <[email protected]>
When DISP_CPU does not report power-on, dcp_s2r_domains_on() returns with SYS, FE, the PMC word and the PMC interface it raised still up, but without setting s2r_domains_up, so dcp_s2r_unwind_failed_start() returns at once and nothing lowers them. Lower them again on that timeout, in dcp_s2r_domains_off()'s order: the PMC word, CPU and FE, then the PMC interface this power-on raised, then SYS. If the interface does not go off, leave SYS up and mark the DCP crashed. Signed-off-by: Erik Bourget <[email protected]>
When a failed start's unwind cannot drain the DARTs or lower the domains, it leaves them up and the DCP crashed, but both DPMS retry flags stay armed: the next unblank clears crashed and powers on and boots again over domains in that state. Remember that state and keep it: dcp_s2r_warm_restart() refuses to run, and the unwind does not touch those domains again, until the driver is bound again. Signed-off-by: Erik Bourget <[email protected]>
The rollback of a power-on whose CPU never came up lowered SYS whenever this power-on had not raised the PMC interface itself, even with that interface already on, which dcp_s2r_domains_off() never does. It also never checked that the CPU went off. Lower SYS only with the interface off or absent, and poll DISP_CPU off as dcp_s2r_domains_off() does; otherwise the rollback fails and the DCP is marked crashed. Signed-off-by: Erik Bourget <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD at 241b8646
Blockers:
- Non-
mainbase branch (feat/apple-pmc-consumer-interface-chain): Fullmainbuild/KUnit/host-tests CI has not run on the combined tree. Once the parent branch lands onmain, please retarget this PR tomain, run full hosted CI, and post an exact-head hardware row covering the power-on rollback path.
Checked:
- Audited commit
241b8646(drm/apple: dcp: keep SYS up under a PMC interface in a power-on rollback,MERGEABLEintofeat/apple-pmc-consumer-interface-chain): resolves the previous merge conflict and ensures power-on rollback only lowers SYS when the PMC interface is off/absent while pollingDISP_CPUoff (marking the DCP crashed if rollback fails).
Evidence
- Head commit:
241b8646ccdfbf9934640fd9766f70351da9ab5c(MERGEABLEintofeat/apple-pmc-consumer-interface-chain). - CI snapshot:
2P/0F/0Qon feature-branch base.
There was a problem hiding this comment.
Verdict: MERGE at 241b8646ccdf
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited commit 241b8646 (drm/apple: dcp: keep SYS up under a PMC interface in a power-on rollback, MERGEABLE into feat/apple-pmc-consumer-interface-chain): resolves the previous merge conflict and ensures power-on rollback only lowers SYS when the PMC interface is off/absent while polling DISP_CPU off (marking the DCP crashed if rollback fails).
Follow-ups (not blocking): Merge parent branch first; follow-ups: retarget, full CI, power-on rollback row
|
Verified head
Exact-head hardware row on J713 (M4 MacBook Air, T8132, 27.2 firmware) at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
drivers/gpu/drm/apple/dcp.c:10822–10825 leaves s2r_domains_up clear after a failed power-on rollback and sets only crashed. The next dcp_s2r_warm_restart() at :11133–11150 checks s2r_start_stuck, then clears crashed with dcp_s2r_forget_crash() and retries over the partially powered domains. Please latch the same terminal state used by the failed-start unwind, and extend the rollback test to check that a second restart is refused.
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), keepdpms_powered_offarmed until restart succeeds, drain both display and DCP DARTs before lowering domains, and roll back or latchs2r_start_stuckcleanly on failed power-ons (bde2a1d9743f..241b8646ccdf); stacked on#3297(retarget tomainafter#3297merges).Tested: At head
241b8646ccdf:LLVM=1 W=1arm64 build clean (drivers/gpu/drm/apple/dcp.o:0errors,0warnings), fulllinux-j713arm64 kernel/DTB/modules build clean (7.3.0+), arm64 QEMU KUnitdisplay.kunitconfig(197passed,1skipped, includingapple-dcp-s2r-pmc17/17) andtopology.kunitconfig(210passed,1skipped,0failed),tools/asahi/run-host-tests.py(837/838passed;apple-dcp84/99ok with the15pre-existing unrelated TAP failures),checkpatch.pl --strict --git 0378182e01b8..HEAD0errors (1pre-existingMAINTAINERSnew-file warning on4b09f0691c2d), andgit merge-tree --write-treeclean against both#3297(0378182e01b8,4e4e63426117) andorigin/main(dadc9aae8eed); J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at the exact head: 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.Risk: two-way door · Apple SoCs using direct-MMIO display-domain S2R/DPMS power-gating (
dcp_s2r_domains_{off,on}()).Not yet: 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(feat/apple-pmc-consumer-interface-chain).6cdd799aca96merged006f20f150fefrom#3297(bringing in#3307frommainand resolving thedcp.cmerge conflicts). Both#3297(0378182e01b8) andorigin/mainnow merge cleanly with241b8646ccdf. Retarget tomainonce#3297lands.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): WhenDISP_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 (marking the DCP crashed if rollback fails).CONFIG_APPLE_PMC=nfallback: Ifapple_pmc_interface_consumer_off()fails after loweringDISP_CPU/DISP_FE, checks and restores PMC on-EALREADYwhile preservings2r_pmc_off = trueif restoration fails. Treats-ENODEV(and-EOPNOTSUPPwith no configured DT PMC interface) as an absent optional interface.git revert -m 1 <merge-commit>on the target branch; kernel driver and KUnit changes only.Evidence
241b8646ccdf, composite with#32970378182e01b8): J713 (M4 MacBook Air, T8132, 27.2 firmware, default command line) at the exact head: 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.241b8646ccdf:./scripts/checkpatch.pl --strict --git 0378182e01b8..HEAD:0errors (0/0/0on6a84c1d95460,597803b9d48b,bde2a1d9743f,b43e08447acd,f29b4f2d9f48,241b8646ccdf;1pre-existingMAINTAINERSnew-file warning on4b09f0691c2dfordcp_s2r_pmc_test.c);git diff --checkclean.make ARCH=arm64 LLVM=1 W=1 drivers/gpu/drm/apple/dcp.o:0errors,0warnings.linux-j713arm64 kernel + DTBs + modules build:exit 0(7.3.0+)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig:Ran 198 tests: passed: 197, skipped: 1(apple-dcp-s2r-pmc17/17passed, covering DPMS retry, D572 timeout, display DART drain,s2r_start_stuck, prewarm unwind, and CPU timeout rollback;1skippedapple_g17_rx_util_min_test, needsCONFIG_UCLAMP_TASK)../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).python3 tools/asahi/run-host-tests.py:837/838passed (apple-dcp84/99ok with the15pre-existing unrelated TAP failures).git merge-tree --write-tree origin/feat/apple-pmc-consumer-interface-chain HEAD: clean (4e4e63426117d3bc062210e81e215450e73980b1);git merge-tree --write-tree origin/main HEAD: clean (dadc9aae8eeda8ee0fe2fbbddb6e0bd1abb6e1ce).4b09f0691c2d(prior to597803b9d48b..241b8646ccdfand#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.