Repository navigation
drm/apple: restore the T6030 firmware 27.2 display after sleep - #3815
Conversation
Firmware 27.2 on the T6030 internal DCP announces infrastructure services such as disp0-service without EPIC identity properties. AFK rejects those announcements and leaves the services unbound. Opt the apple,t6030-dcp hardware profile into the existing announced name fallback for firmware interfaces in the 27.0 compatibility class. Use the fallback only when the parsed properties lack EPIC identity. Keep the J716c sleep transport exception scoped to md-manager. Signed-off-by: DjDeveloperr <hey@djdev.me>
Signed-off-by: Diljit Singh <hey@djdev.me>
Keep the parser error for an ill-formed EPIC dictionary. The T6030 announced-name fallback may recover from a missing identity, but it must reject an invalid one. Model the new match flag in the host fixture and cover a dictionary with a non-integer EPICUnit. Signed-off-by: Diljit Singh <hey@djdev.me>
Gate commands and save the internal display DART streams before the DCP powers down. Check retained translation registers before re-enabling streams on wake. Leave unused, invalid streams off and refuse to resume a DART with lost live mappings. Signed-off-by: Diljit Singh <hey@djdev.me>
|
J516s |
|
Head |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J516s (T6030, M3 Pro) hardware qualification PASS for exact head
|
Check apple_dart_power_dark() in apple_dart_v27_cycle_off() before gating commands and abort cleanly on failure. In apple_dart_v27_cycle_release(), when the post-lit TLB flush fails (on either cycle_off() idle-error rollback or cycle_on()), restore display_tlb_stale, re-enter dark mode, and re-gate commands instead of leaving the DART live with an un-flushed TLB. Add KUnit coverage (apple_dart_test_v27_cycle_errors) for failed dark-mode entry and failed TLB flush on both rollback and cycle_on(). Signed-off-by: Diljit Singh <hey@djdev.me>
Limit the temporary driver override to the cycle-off call. An assertion can abort the test before the final cleanup, leaving the driver core to unbind a KUnit device with the platform driver still installed in its driver pointer. Save and restore the prior driver under the device lock. Signed-off-by: DjDeveloperr <hey@djdev.me>
Match apple_dart_display_dark_exit() in apple_dart_v27_cycle_release(): mark display_tlb_stale, drain in-flight display_dark_writers under managed_lock, and complete the post-lit TLB flush before clearing commands_gated and display_dark. If writers fail to drain or the flush fails, keep the DART dark, gated, and marked stale. In apple_dart_v27_cycle_flush() and the pre-stream flush in apple_dart_v27_cycle_on(), wait for DART_T8110_TLB_CMD_BUSY to clear before writing FLUSH_ALL so a busy rollback does not clobber an active TLB command. Extend apple_dart_test_v27_cycle_errors() to cover busy-command rollback preservation, in-flight dark-writer draining before the final flush, and stuck dark-writer -EBUSY rollback. Signed-off-by: Diljit Singh <hey@djdev.me>
Recheck display_dark_writers and display_tlb_stale under managed_lock immediately after a successful apple_dart_v27_cycle_flush() so a dark writer finishing on the final sleep still completes release cleanly instead of returning -EBUSY with display_tlb_stale cleared. On an actual retry-budget timeout, re-mark display_tlb_stale = true before returning -EBUSY. Allocate apple_dart_test_dark_writer_ctx with kunit_kzalloc() before entering the cycle instead of placing a delayed_work on the stack. Signed-off-by: Diljit Singh <hey@djdev.me>
Signed-off-by: Diljit Singh <hey@djdev.me>
Describe the register windows for the internal DCP and the power gates and retention registers for idle external coprocessors. Signed-off-by: Diljit Singh <hey@djdev.me>
Guard PMP accesses if SRAM recovery fails. Require the live target and ACK before a consumer starts its firmware. Signed-off-by: Diljit Singh <hey@djdev.me>
Cycle the internal DCP and retain its DART mappings, then reopen the AFKV2 and AV services before presenting the panel again. Wait for the live PMP display target and ACK before releasing RUN. Keep supported external DCPs in firmware-only idle sessions. Signed-off-by: Diljit Singh <hey@djdev.me>
Mirror the probe-time start and sleep retention fields in the fixture. Supply the powered-SRAM predicate for the extracted report paths. Signed-off-by: Diljit Singh <hey@djdev.me>
f1fd661 to
2644abc
Compare
|
J714s (M5 Pro, T6050) second-generation peer-control S2R row at exact unchanged head Candidate:
|
|
J516s (M3 Pro, T6030) integration receipt on PR #3815 exact head:
|
There was a problem hiding this comment.
Verdict: MERGE at 2644abc
Checked:
- T8112/T6000 sleep paths: in pmp-report.c,
sleep_keep/start_at_probeexist only inapple_pmp_offsets_t6030, and the probe start also needs a handed-over PMP. The display-gate.c GPU and dcpext changes are gated togate_t6030/apple,t6030-dcpext. sleep.c only adds two statics and their getters, and no existing function changes. Thesleep_v27_closedbool->enum keeps its old meaning at every write and for every bool-style reader (cec.c, iomfb.c, dcp.c). - T8122 WAKE_SLP_DDR: sleep-t8103.h is untouched and no existing sleep.c function is edited, so a T8122 port won't conflict.
- Suspend refusal (undo/reopen/restart/lost) and both resume paths: walked through, no leak, wrong order or NULL dereference. The early-stop paths are gated by
hw.v27_early_stop(T6030 only), with stubs for builds without sleep support. - Built W=1 (arm64 gcc): drm/apple, sleep.o, display-gate.o, pmp-report.o and the j516s/j514s DTBs, with no new warnings. dcpext26-startup, t6030-pmp-supplier and t6030-pmp-graph (27 cases) pass. The parser.c ret change keeps the -ENOENT KUnit case passing.
- J516s 2-cycle exact-head deep receipts plus the J714s peer row. Offsets are cited to our own macOS/HV traces, and there are no blobs or disassembly.
Follow-ups (not blocking):
pmp_sram_failed/pmp_wake_errorin sleep.c are never set, so theapple_sleep_pmp_sram_ok()gates are no-ops. Wire up the T6030 PMP restore result or drop them.- The dcp.c log line and the dcp-t6030-ext272.inc header name a parameter that doesn't exist,
apple_t6030_display.dcpext_272_idle=1. dcp_v27_early_pmp_wait()can return -EPROBE_DEFER intodcp_start(). apple_drv treats that as a start failure, and it can stall DRM bring-up for up to 30 s (T6030 only).- Changes that reach every SoC:
bl_update_wqis now scheduled after a modeset, andV27_WAKE_HOTPLUG_MSgoes 250 -> 1000. Both look harmless. A T8112/T6000 S2R smoke row on the integrated batch would close this out. - Trim the TEST-labelled
ext272_*params and the per-message AFKV2 info logs before the stack leaves TEST. apple,t6030-display-powerhas a binding schema but no driver. dtbs_check was not run.
satchlj
left a comment
There was a problem hiding this comment.
Verdict: APPROVE at 2644abcd
Reviewed the shared-file hunks and new T6030 sleep/DART/dcpext paths across the diff:
- Scoping & shared-driver safety:
v27_early_stop,afk_name_fallback, anddcp_s2r_t6030are enabled only inapple_dcp_hw_t6030;start_at_probeandsleep_keep(BIT_ULL(16)) are set only inapple_pmp_offsets_t6030;display-gate.cGPU AGX/auto-PM and 27.2 idle-only dcpext paths are strictly gated togate_t6030/apple,t6030-dcpextwith27.2.0+ image UUID. Convertingsleep_v27_closedfrombooltoenum(DCP_V27_TX_LIVE = 0,REPLIES = 1,PANEL_OPEN = 2) preserves existing boolean readers, andDCP_V27_TX_PANEL_OPENadmits onlyj516s_panel_serviceAFKV2 open/command frames.parser.cpreserves an earlier parse error instead of overwriting it with-ENOENT. - DART & DCP suspend/resume/refusal paths:
apple_dart_v27_cycle_off()restricts strictly to T8110 DARTs< 0x0202not otherwise held, rolls back cleanly on idle failure, andapple_dart_v27_cycle_on()refuses to ungate ifapple_dart_v27_cycle_same()detects lost translations, drainingdisplay_dark_writerswith TLB flush before clearing dark mode. Indcp-v27-sleep.inc, every pre-close refusal leaves hardware untouched, mid-sequence refusal runsundo+reopen, post-stop failure in suspend triggersdcp_v27_early_restart()inline, and PMGR floor state (min[]) is restored on every exit. - CI & hardware evidence: 6/6 CI checks pass at
2644abcdee33, with exact-head J516s 2-cycle 30 s deep-sleep receipt (#issuecomment-7343746579, eDP-13456x2234 link: 1, 0 DCP/IOMFB/DART errors) and J714s second-generation peer-control S2R PASS (#issuecomment-7339040430).
Non-blocking follow-ups:
- Remove the stale
apple_t6030_display.dcpext_272_idle=1parameter name from thedcp.cdev_errmessage anddcp-t6030-ext272.incheader comment (the idle-only 27.2 path works automatically on the default command line). - Wire up or drop the currently unwritable
pmp_sram_failed/pmp_wake_errorstatics indrivers/soc/apple/sleep.c. - Note
dcp_v27_early_pmp_wait()can return-EPROBE_DEFERintodcp_start()(and block up to 30 s on T6030); ensure defer propagation and trim theTEST-labelledext272_*module parameters/verbose AFKV2 logs in a follow-up cleanup.
The merge-base changed after approval.
satchlj
left a comment
There was a problem hiding this comment.
Re-approving exact head 2644abcdee33 after the merge-base shift auto-dismissed the previous approval — head SHA, diff, green CI, and exact-head hardware rows are unchanged.
The merge-base changed after approval.
|
The warm AArch64 build and host tests passed on pc. Tested merge tree export GIT_NO_LAZY_FETCH=1 TMPDIR="$job/tmp"
git -C linux-tb merge-tree --write-tree --merge-base=01bbc1d13c30756ddeaaa26ee3c661621d6abc10 6d67feab0a46cc37a91e4f1c6cc4e655aa322db1 2644abcdee3368d7b89535fe32e1e69776c17b8d
build=(~/bin/aurora-build make -C "$src" O="$out" ARCH=arm64 LLVM=1 CC='ccache clang' BINDGEN="$out/aurora-bindgen/bin/bindgen")
"${build[@]}" olddefconfig
"${build[@]}" -j8 W=1 drivers/gpu/drm/apple/ drivers/soc/apple/ drivers/pmdomain/apple/ apple/t6030-j516s.dtb
cd "$src"
~/bin/aurora-build python3 tools/asahi/t6030-pmp-supplier-tests.py --mutations --output "$job/host-supplier"
~/bin/aurora-build python3 tools/asahi/t6030-pmp-graph-tests.py --mutations --output "$job/host-graph"
~/bin/aurora-build python3 tools/asahi/dcpext26-startup-tests.py --mutants
~/bin/aurora-build python3 tools/asahi/t6030-pmp-dt-tests.py --dtc "$out/scripts/dtc/dtc" --output "$job/host-dt"The four host suites passed, including all four J514s/J516s device-tree profiles. The preceding full J516s DTB compile emitted the same 18 warnings as the prior main baseline build. |
What: Restore the T6030 internal firmware-27.2 display after a full power cycle. Keep the DART translations, reopen AFKV2 and AV services in order, check the live PMP display vote, and resume presentation. Use idle-only sessions for supported external DCPs, without admitting scanout or Type-C routes.
Tested: Clang AArch64 built the DCP, IOMFB, display gate, PMP report and sleep provider objects and the J516s DTB. Both DT schemas passed validation. All 19 AFK, native startup, T6030 display and PMP supplier host runs passed. Strict checkpatch was clean with the new-file reminder excluded because the DRM Apple maintainer glob already covers the added include.
J516s, integrated kernel
af2647f710fd,direct-t357h-02: the internal DCP restarted and modeset to 3456×2160 at 120 Hz after both same-boot wakes. Backlight stepped 25 → 75 → 25, with zero new priority 0–3 kernel records in either wake window. The second RTC latch check failed.Risk: Two-way door. T6030 match data and firmware handoff select the new display path. AFK and the display power plumbing are shared.
Not yet: Hardware rows at this head on J516s and a second DCP generation, including display wake and external port regression. Stacked on #3807 for display DART retention and includes #3768 for AFK name fallback. Both prerequisites are needed to review and test the full sequence.