Repository navigation
T8122: get the J615 (firmware 27.2) through a deep-sleep entry: keep the live MTP DART, stop the internal DCP cold - #3413
RyanTheTide wants to merge 3 commits into
Conversation
…akes it for good On T8122 the sleep's commit powers the internal display coprocessor down and nothing starts it again after the wake (the SoC's sleep data says so: display_no_restart). Its driver stopped it cold for that commit only on the 26.6 image. On the 27.2 image (J615, MacBook Air 15-inch M3) the DCP took the ordinary suspend path: the commit then cut its power under the running firmware, and on the J615 the commit either fell through at once and the resume ran into the dead firmware (a panic a few seconds after the sleep started), or did not get going at all. Let the sleep driver say which display coprocessor its commit takes for good: apple_sleep_display_no_restart(dev) is true for the first of the sleep node's apple,display-coprocessors (the internal display) on a SoC whose sleep data has display_no_restart, during a firmware sleep. The DCP driver then stops that coprocessor cold before the commit, as it does for 26.6, and leaves it stopped until a reboot. Nothing changes for any other SoC, for external display processors, for suspend-to-idle or for a dry run. Signed-off-by: Ryan Murray <[email protected]>
There was a problem hiding this comment.
Verdict: FINISH, then merge.
Blocker: The firmware-27 DCP now stops irreversibly in its device suspend callback, before the platform's remaining refusal checks. If a later device or the platform declines the sleep, the kernel can unwind to an awake laptop with its panel still off until reboot. Please preserve the display on this abort path or move the cold stop behind the refusal checks. The DART retention fix can be reviewed independently.
Checked: The new ownership predicate matches the first display phandle, so it does not select DCPEXT when the DT is ordered as documented. It requires firmware sleep, and dry run still skips the cold stop. The live-MTP DART retains bypass and checks it on resume. The J615 default s2idle row passed. The deep row still resets and bypasses the GPU and external display paths, so it does not exercise a normal late refusal with the internal panel kept usable.
|
Thanks, agreed on the blocker. Reply per item:
|
… last refusal The previous change stopped the firmware-27 T8122 internal DCP cold in its .suspend. Any later refusal (another device's .suspend, the engine's coprocessor checks, the SMC notice, a pending wakeup, SEP) then unwound to an awake Mac whose panel stays off until a reboot. The engine's own T8122 display_off has the same hole: it powers DISP_CPU down at the start of the entry, before those checks. Stop that DCP where nothing can refuse any more instead: - The DCP's suspend is the ordinary one again (firmware left running), and where the SoC's sleep data says the commit powers this display down for good (apple_sleep_display_no_restart()), it registers a last stop with the sleep engine, in its first pass of stops (as the GPU registers): RTKit AP/IOP idle, polled with interrupts off, the receive bit off and its run bit cleared. - The engine does not count such a readied internal display as a running coprocessor at its refusal check, and powers it down (display_off) only right after that first pass of stops, past the last refusal and still before the wake is armed and macOS's off words drop. A failure there goes on to the commit, as a failed coprocessor stop does. - The DCP's .resume asks apple_sleep_coproc_stopped(): a committed sleep stopped the firmware, which stays stopped until a reboot, as on 26.6; a refused one resumes it as usual. - apple_sleep.refuse_late=1 (test only, one sleep) refuses an early_context sleep at its very last check, after every other, to row what such a refusal unwinds. The 26.6 DCP keeps its cold stop in .suspend, and an engine whose display has no readied stop keeps display_off where it was, so nothing changes for J613 26.6, for other SoCs, for external display processors, for s2idle or for a dry run. Signed-off-by: Ryan Murray <[email protected]>
|
Reworked per the plan in my earlier comment (new commit on top; no force push):
Rows at |
|
The forced-late-refusal row that was blocked by #3435 is done. Fix: #3445. J615 (27.2 firmware), kernel = this head 66923b1 + #3445 (deep=1, untested_commit,
Also at this head + #3445: deep dry run passes (eDP enabled after); default cmdline smoke + s2idle 3/3 OK; a deep commit still hits the J615 60 s post-commit reset (separate, open). Before #3445 the same row panicked in NVMe (SError), not in the DCP. Marking ready. The refuse_late rows need #3445 underneath; the rest of this PR doesn't depend on it. |
There was a problem hiding this comment.
The original DCP refusal blocker is resolved in source: the ordinary suspend path leaves the controller running. The readiness-gated deferred power-off and first stop occur after the final checks and SEP success, and refusal disarms the registered callback and resumes normally. The J615 3/3 combined run confirms eDP remains enabled in DRM after a late refusal. Treat this as code approval only. Land #3425 and a corrected #3445 first, then refresh the refusal row with the corrected dependency and verify visible scanout as well as DRM state. The committed sleep still resets, so leave the existing deep-sleep qualification gate in place.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Update: #3445 changed under this PR (b0ced07: ANS's old buffers are kept while it uses them). This head 66923b1 + #3445 b0ced07 on J615: refuse_late 4/4 on the same boot with |
|
Refusal row on the merged base, as asked: #3425 and #3445 are in main now, so the forced late refusal no longer stops in NVMe (#3435). Kernel: main Visible scanout: DRM reporting
Kernel errors on the default-cmdline boot that the fleet kernel doesn't show: A committed deep sleep is unchanged: the J615 still doesn't wake from it on 27.2 firmware. That's a separate open issue, and this PR doesn't claim it. |
Resolve dcp_platform_resume(): run the commit-stop disarm first so it always unregisters, then the v26 sleep resume from main. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD at 1fae0d6a65b7
Blockers:
- Hosted CI at
1fae0d6a65b7is still queued (29jobs queued:apple-build,host-tests,rust-build,pr-text,readiness,DWC3/ATCmatrix, and KUnit suites) — wait for all checks to complete green.
Checked:
- Audited the full 4-file diff (
+133/-1,MERGEABLEagainstmain) and merge commit1fae0d6a65b7: resolvingdcp_platform_resume()by runningdcp_commit_stop_disarm(dcp)beforedcp_v26_sleep_resume(dcp)cleanly ensures the registered commit-stop callback is always unregistered on resume while preservingmain's v26 sleep resume path. - Previously approved logic at
66923b11(dcp_commit_stop_arm(),dcp_commit_stop(),sleep_display_late(),apple_sleep_display_no_restart(),refuse_late) and J615 hardware verification (refuse_late4/4,s2idle3/3, merged-base refusal row) remain intact.
Evidence
- Head:
1fae0d6a65b7e0874ba060ca7c2c16c17c5ebe8f(basemain,MERGEABLE, merge ofmain07cb39a289over66923b11b0). - Ready to approve once hosted CI passes green at
1fae0d6a65b7.
|
Merge-up review (our own PR, so no approval from this account): conflict-pass merge commit 1fae0d6: dcp.c resume keeps main's dcp_commit_stop_disarm block alongside the PR change. Nothing outside the conflict. Needs a non-author approval plus CI and rows at this head before merge. |
There was a problem hiding this comment.
Verdict: MERGE at 1fae0d6a65b7
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 the full 4-file diff (+133/-1, MERGEABLE against main) and merge commit 1fae0d6a65b7: resolving dcp_platform_resume() by running dcp_commit_stop_disarm(dcp) before dcp_v26_sleep_resume(dcp) cleanly ensures the registered commit-stop callback is always unregistered on resume while preserving main's v26 sleep resume path.
- Previously approved logic at
66923b11(dcp_commit_stop_arm(),dcp_commit_stop(),sleep_display_late(),apple_sleep_display_no_restart(),refuse_late) and J615 hardware verification (refuse_late4/4,s2idle3/3, merged-base refusal row) remain intact.
Follow-ups (not blocking): queued hosted CI
|
J615 (MacBook Air 15", M3, T8122, firmware 27.2) at |
What: Two fixes that let the M3 MacBook Air 15" (J615, T8122, macOS 27.2 firmware) get through a deep-sleep entry on the merged T8122 sleep framework (#3140). (1) The MTP DART, which the boot loader hands over live (
apple,bypass-handoff-streams), refused every sleep but suspend-to-idle with-EBUSY; it is now kept through a firmware-driven sleep exactly as through s2idle (the rtkit helper already keeps the MTP running then). (2) The internal DCP on the 27.2 image is now stopped by the sleep engine after the sleep's last refusal, where the sleep driver's own SoC data says its commit powers that coprocessor down for good (newapple_sleep_display_no_restart(dev), T8122 only today). Before, the commit cut its power under running firmware and the resume panicked. Its.suspendstays the ordinary one. It registers a first-pass last stop (polled RTKit idle, run bit cleared), and the engine moves T8122'sdisplay_offbehind that stop, so a refused sleep leaves the display running..resumeasksapple_sleep_coproc_stopped(). (3) Test-onlyapple_sleep.refuse_late=1refuses one early_context sleep at its very last check.Tested: J615 M3 Air 15" at
66923b11merged on main18058ea2(with #3425 + #3445): forced late refusal of a deep sleep 3/3 recovered on the same boot, with the internal DCP completing swaps after each (16/16, 16/16, 18/18 against a 16/16 baseline) and NVMe 4.9-5.2 GB/s; default command line boot smoke + s2idle 3/3, 0 failed units (row in the PR comments). Earlier, at66923b11on the old base: J615 default-cmdline boot smoke + s2idle 3/3 OK; deep dry runevery check passed, panel back; commit: reset 60 s after the commit, no resume panic (same as before). (On that base the forced late refusal stopped in NVMe's refused-sleep recovery, #3435, fixed by #3445.) Earlier, J615 (M3 Air 15", 27.2 firmware) at6a757b15, kernel built from this head with the fleet config, main's J615 DTB via a one-shot: default command line boot smoke (eDP, MTP keyboard/trackpad, Wi-Fi, NVMe 5.1 GB/s, Enforcing, 0 failed units) and s2idle 3/3 with all of it still up after each (0 'MTP bypass lost'); withapple_sleep.deep=1(GPU blacklisted, DCPEXT off): dry runevery check passed(was-EBUSYfrom2fa808000.iommu), and a committing sleep now runs to the last mile and is reset 60 s after the commit instead of panicking in the resume ~10 s in. J473 (M2 mini, T8112, not an affected family: no change expected) at6a757b15: boot smoke (both displays, input, Wi-Fi, NVMe, Enforcing, 0 failed) and s2idle 3/3 OK.Risk: two-way · only Macs whose sleep data has
display_no_restart(T8122: J613/J615) or whose boot loader hands the MTP over live, and only in a firmware (deep) sleep; T8122 deep sleep is still opt-in (apple_sleep.deep=1,untested_commit). s2idle and every other SoC unchanged.Not yet: the J615 still does not wake from deep sleep: after these fixes it is reset 60 s after the commit, independent of the RTC alarm (open, see Details). GPU (G15G 27.2
deep_sleep: false) and the 27.2 DCPEXT still refuse/aren't stopped; rows usedmodprobe.blacklist=auroraandapple_t8122_display.dcpext=0to isolate.Details
apple_dart_system_suspend()refused anything butPM_SUSPEND_TO_IDLEfor a live-MTP DART. In a firmware sleepapple_rtkit_helper_suspend()keeps the MTP firmware running (AP idle notice only), so its DART is kept the same way: no save/reset,device_set_awake_path(), and the resume checks stream 1 is still in bypass (-EIOand an error otherwise). The noirq callbacks skip it, since the runtime suspend they'd call refuses a live MTP.dcp_sleep_owned()was 26.6-only. On 27.2 the DCP took the ordinary suspend path, the T8122 commit powered DISP_CPU off cold, and the resume talked to dead firmware. Nowdcp_sleep_owned()= (26.6 and not external) orapple_sleep_display_no_restart(dcp->dev). The new helper is true only during a firmware sleep, on a SoC whose sleep data setsdisplay_no_restart, for the device that isdisplay[0]of the sleep node'sapple,display-coprocessors(the internal display). No chip/board/firmware-version gate. Same trade-off as the merged 26.6 path: panel off until reboot after a committed sleep (no 27.2 restart path yet); a sleep refused after the DCP's.suspendalso leaves it stopped..suspendonly when the sleep commits (!apple_sleep_dry_run()), as for 26.6..resumeis never reached. On this firmware aura publishes/chosen/aurora,s2r-mailbox(it points RVBAR at itself on M3), so a wake enters aura'ssmp_s2r_return_to_os()first; that writes one line on the always-on DockChannel, which a KIS capture can show (next step).Evidence
Lane rows (J615, one-shot aura-try with only the DTB replaced by main's, GRUB one-shot, RTC wake, M1 Pro VDM dead-man):
traces/power/20261128-m3-deepsleep/README.md(lab store).apple-dart 2fa808000.iommu: platform_pm_suspend returns -16dry run: every check passed0x7e(back in Linux before device resume) -> panic reboot ~10 s later (kernel.panic=0moves the reset to ~+67 s)0x60(last mile), no panic; reset ~60 s after the commit, RTC +15 s and +45 s alike6a757b15, default cmdlinedwc3-apple ... genpd_prepare returns -11lines are on production fleet90's s2idle too)deep=1(GPU blacklisted,dcpext=0)dry run: every check passed66923b11, default cmdline66923b11,deep=1dry run: every check passed; panel back, brightness restored66923b11+refuse_late=1(pr2Drl: + DEV-only PMU notes and kmsg dumper, not in this PR)apple_nvme_reset_work->apple_rtkit_reinit->apple_nvme_sart_dma_destroy->sart3_get_entrySError (#3435)66923b11, commit, RTC +15 sdwc3-apple ... -11and brcmfmacLPAS setup failed (-107)lines are in the J473's production baseline too