Skip to content

drm/apple: pause and settle presentation during firmware-27 paired stop - #3305

Merged
RyanTheTide merged 10 commits into
mainfrom
fix/dcp-v27-peer-quiesce
Dec 1, 2026
Merged

RyanTheTide merged 10 commits into
mainfrom
fix/dcp-v27-peer-quiesce

Conversation

@erikwb

@erikwb erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Pause new DRM presentations and settle in-flight swaps around firmware-27 paired teardown and modeset so iomfb_queue_work() cannot launch a swap into dcp_peer_probe_quiesce() and mark the primary DCP crashed; cancel the swap watchdog via dcp_swap_watchdog_cancel() without crediting a completed scanout when retiring a stalled present; synchronize dcp_peer_record_retired_v27() with concurrent driver unbind and revalidate the reservation before recording retired swap IDs; serialize firmware-27 paired modeset/stop transitions on dcp_peer_stop_wq, check !peer_transition_active && !peer_frames.active atomically under dcp_peer_lock (never returning 0 from an unlocked split check at stop entry or retry exits, so unplug/power-off waits out any concurrent modeset that clears peer_frames.active mid-quiesce and stops the replacement pair), and bound retry admission to 1000 ms under dcp_peer_lock before claiming peer_transition_active (an already-admitted attempt can run past the deadline) in both dcp_peer_unplug_v27() and iomfb_poweroff().
Tested: At head 6557cb21bf91 (21293a31b6ef with origin/main dbfbced70b31 merged and its conflicts resolved): arm64 kernel builds (linux-j716c and linux-j713 profiles, LLVM=1) clean with 0 Apple DRM warnings or errors; arm64 QEMU Apple DRM KUnit (display.kunitconfig: 180 passed, 1 skipped, 0 failed; topology.kunitconfig: 211 passed, 1 skipped, 0 failed, including apple-dcp-dropped-swap 14/14 with stalled_present_retired_test); host tests (apple-dcp --group display 24/24 under HOSTCC=gcc and panel-adaptive-watchdog under HOSTCC=clang; dcpext26-queue-tests.py and dcp-peer-shown-tests.py passed with --drop-v27-close, --always-shown, --owner-only, and --drop-retire-sync negative controls caught); checkpatch.pl --strict clean (0 errors, 0 warnings, 0 checks). J716c (16-inch M5 Max, T6050, firmware 27.2, AC, default command line, default Stage 2) at 6557cb21bf91 (main base dbfbced70b31) in a one-shot trial kernel built from this head (Linux 7.3.0), no external display attached: 4x eDP-1 DPMS off/on (hl.dsp.dpms) each returned to 3456x2234@120 with the connector connected / enabled, a pm_test=devices suspend/resume cycle returned to the same mode, 0 GPU fault / MMU fault / DeviceLost / Oops / WARN lines and 0 new dmesg err/warn lines from the DPMS and suspend cycles; smoke: Apple MTP keyboard / trackpad and lid devices enumerated, wlan0 0% loss over 3 pings, Borealis Apple M5 Max (G17C B1) with vkcube --c 240 --wsi wayland clean, 1 failed unit (aurora-peripherals.service, also failed on the default boot), 0 LSM denials. J713 (M4 MacBook Air, T8132, firmware 27.2, battery, default command line, GRUB one-shot + one-shot Stage 2 with t8132-j713.dtb, no external display attached) at 6557cb21bf91 in a standalone trial kernel built from main + this head (Linux 7.3.0): eDP-1 connected and enabled, 0 failed units, 0 AppArmor denials, 0 Oops/WARN, DPMS off/on x3 before and x2 after sleeps (each off false, each on true), s2idle x3 (suspend_stats success 1 -> 2 -> 3, fail 0), and no new err line (external display processors do not probe on a main-only J713 tree, +2 -ENODEV err lines); earlier pre-merge hardware rows at a2af02271056 / 4654596c5a86 / e73cdf440c06 are in Evidence.
Risk: two-way door · M5 (T6050) and other firmware-27 external paired-DCP Macs; touches shared iomfb.c queue/retire helpers, dcp_swap_watchdog_cancel(), and dcp_comp_unbind() / dcp_platform_remove() peer synchronization (all other Macs retain existing single-pipe behaviour).
Revert: git revert -m 1 <merge-commit> (all state is in-memory driver runtime state; no persistent on-disk, ESP, or firmware state is modified).
Not yet: J716c (T6050) physical dual-external cable-pull / external hotplug under active paired flips and s2idle regression at 6557cb21bf91 (no external display attached in this row; the RTC alarm cannot wake J716c from s2idle unattended); J713 (T8132, firmware 27.2) external-display hotplug/unplug at 6557cb21bf91 (no external display attached and external display processors do not probe on a main-only J713 tree); completion of the queued hosted CI checks at 6557cb21bf91.

Details

Root cause

dcp_peer_stop_v27() and dcp_peer_modeset_v27() previously checked only channel depth before calling dcp_peer_probe_quiesce(), leaving iomfb_queue_work() free to start queued DRM swaps during the ~220 ms A484(0) / msleep(100) / A362(0) sequence. Once dcp_peer_probe_quiesce() cleared modeset_complete while peer_frames.active was true, a racing swap hit ERR_PTR(-EIO) in dcp_peer_start_second(), called dcp_peer_swap_error(), and permanently set owner->crashed = true. That caused A362(0) to time out (-110), iomfb_poweroff() to fail with -EBUSY, the active IOMFB transaction to hang until its 10 s timeout, atomic commits to fail with -EINVAL, and the second external display to fail to light on replug.

In addition, iomfb_poweroff() called dcp_peer_stop_v27() without retry while dcp_peer_unplug_v27() retried for only 100 ms, shorter than dcp_peer_probe_quiesce(), causing concurrent unplug and CRTC power-off to race into -EBUSY.

Changes

  • Add an orthogonal iomfb.peer_paused gate (iomfb_pause_peer()) separate from sleep/DPMS presentation_paused, preventing new presentations from starting while allowing in-flight presents to drain.
  • Pause and settle (iomfb_queue_settle()) around dcp_peer_stop_v27() and dcp_peer_modeset_v27().
  • If a cable pull drops a paired swap completion while dcp_poweroff() has already cancelled swap_watchdog_wq, retire the stalled present via iomfb_retire_stalled_present_h17p() (retaining DMA references on iomfb.dropped, cancelling the retired present's watchdog via dcp_swap_watchdog_cancel() without resetting swap_watchdog_retrains or calling dcp_takeover_adopt_proven(), advancing the queue, and recording the retired ID on both primary and peer).
  • Sync primary retired and D597-aborted swap IDs to the peer (dcp_peer_sync_retired_v27()) before clearing peer_frames.active, so late peer completions after teardown do not fall through to the single-pipe handler and mark the peer crashed; synchronize dcp_peer_record_retired_v27() across dcp_peer_retire_rwsem (drained after dcp_peer_forget() on unbind/remove/shutdown) and revalidate the reservation under peer->iomfb.lock -> dcp_peer_lock before mutating peer->present_state_h17p.
  • Invalidate mode_state before clearing modeset_complete / peer_frames.active (paired with smp_wmb() / smp_load_acquire()), so concurrent iomfb_poweroff() cannot issue a single-pipe clear swap on a stopped pipe and a failed stop cannot reopen presentation with inconsistent pair state.
  • Serialize firmware-27 paired modeset and stop transitions under dcp_peer_lock, wake dcp_peer_stop_wq on transition completion after releasing dcp->dev, perform the terminal !peer_transition_active && !peer_frames.active check atomically under dcp_peer_lock (never returning 0 from unlocked split reads at stop entry or retry exits, while checking peer_transition_active before !peer_frames.active in wait_event_timeout() predicates) so an unplug or power-off waits out a concurrent modeset that clears peer_frames.active mid-quiesce and stops the new pair, and carry the 1000 ms deadline into dcp_peer_stop_v27_once() so it is rechecked after acquiring dcp_peer_lock before claiming peer_transition_active — retry admission is bounded by the deadline while an already-admitted attempt can run past the deadline in dcp_peer_stop_wait_v27() (used by dcp_peer_unplug_v27() and iomfb_poweroff()).
  • Mirror iomfb.peer_paused in tools/asahi/dcpext26-queue-tests.py, cover dcp_peer_record_retired_v27() stale-reservation/concurrent-unbind races and dcp_peer_stop_wait_v27() serialization, mid-modeset inactivity clearing, split-observation modeset races at stop entry and retry exits, dcp_peer_lock-held expiry, and deadline enforcement in tools/asahi/dcp-peer-shown-tests.py, extract dcp_swap_watchdog_cancel() and verify it in tools/testing/selftests/drivers/gpu/apple-dcp/display.py (panel-adaptive-watchdog), and cover stalled-present retirement and dcp_swap_watchdog_cancel() in drivers/gpu/drm/apple/dcp_dropped_swap_test.c (stalled_present_retired_test).
Evidence
  • Commits on fix/dcp-v27-peer-quiesce (base 8c6992db4b9f, forward-merged with origin/main up to dbfbced70b31):
    • e73cdf440c06 drm/apple: pause and settle presentation during firmware-27 paired stop
    • 7ff10c06ab58 tools/asahi: add peer_paused field to dcpext26-queue-tests mock (host-test-only)
    • 4654596c5a86 drm/apple: synchronize peer retired-swap recording with unbind
    • 55bd177edf85 drm/apple: cancel watchdog without proving takeover on stalled present
    • 01709acaef93 drm/apple: wait on in-flight paired stop without polling past deadline
    • 30e47db14ffa drm/apple: keep paired stop waiting across modeset quiesce and bound admission
    • a2af02271056 drm/apple: check paired stop inactivity atomically under dcp_peer_lock
    • f872c293bc3f selftests/apple-dcp: extract dcp_swap_watchdog_cancel in watchdog test (host-test-only)
    • 21293a31b6ef Merge branch 'main' into fix/dcp-v27-peer-quiesce (resolved conflict with main's removal of peer_scanout)
    • 6557cb21bf91 Merge remote-tracking branch 'origin/main' into fix/dcp-v27-peer-quiesce (clean merge of dbfbced70b31)
  • Verification at 6557cb21bf91:
    • Arm64 kernel builds (linux-j716c and linux-j713 profiles, LLVM=1): both passed with 0 Apple DRM warnings/errors.
    • KUnit (./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig): Ran 181 tests: passed: 180, skipped: 1 (0 failed).
    • KUnit (./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/topology.kunitconfig): Ran 212 tests: passed: 211, skipped: 1 (0 failed; apple-dcp-dropped-swap: 14/14 passed including stalled_present_retired_test).
    • apple-dcp display group (HOSTCC=gcc python3 -E -s -B tools/testing/selftests/drivers/gpu/apple-dcp/run.py --group display): 24/24 passed (ok 1 .. ok 24 - panel-adaptive-watchdog); panel-adaptive-watchdog also passed under HOSTCC=clang.
    • Host tests (python3 tools/asahi/dcpext26-queue-tests.py, python3 tools/asahi/dcp-peer-shown-tests.py): both passed; negative controls (--drop-v27-close, --always-shown, --owner-only, --drop-retire-sync) were caught.
    • Style (./scripts/checkpatch.pl --strict --git 8c6992db4b9f..f872c293bc3f and git diff 6557cb21bf91^2..6557cb21bf91 -- drivers/gpu/drm/apple/ | ./scripts/checkpatch.pl --strict -): 0 errors, 0 warnings, 0 checks.
    • Merge check against current main (a171afd2123f): git merge-tree --write-tree clean with 0 conflicts.
    • J713 (M4 MacBook Air, T8132, firmware 27.2, battery 50% to 43%, default command line, GRUB one-shot + one-shot Stage 2 with t8132-j713.dtb, no external display attached) standalone trial kernel at 6557cb21bf91 (main + this head, Linux 7.3.0; external display processors unprobed, +2 -ENODEV err lines): eDP-1 connected and enabled, 0 failed units, 0 AppArmor denials, 0 Oops/WARN, DPMS off/on x3 before and x2 after sleeps (each off false, each on true), s2idle x3 (suspend_stats success 1 -> 2 -> 3, fail 0), no new err line.
  • Pre-merge hardware history (before 21293a31b6ef / 6557cb21bf91, retained for reference only; not head rows for 6557cb21bf91):
    • J716c (16-inch M5 Max, T6050) combined-build candidate c3da8eed6f72 (incorporating a2af02271056 over main 9af21b007425, AC 100%, internal eDP-1 only): 6 eDP-1 DPMS off/on cycles (dpms false while off, true at 3456x2234@120 on wake, 0 DCP/IOMFB/watchdog errors, 0 paired power-off failed, 0 timeouts).
    • J713 (M4 Air, T8132, firmware 27.2) combined-build candidate b3dbf237542b (incorporating a2af02271056 over main 9e38a276dcb4, internal eDP-1 only): clean boot, 0 failed units, 0 LSM denials, single-pipe eDP-1 2560x1664@60 clean across 3x real DPMS off/on cycles and 3x s2idle (rtcwake -d /dev/rtc1 -m freeze -s 5, 3/3 PASS), 0 DCP/IOMFB/watchdog/swap errors.
    • J716c (T6050) at 4654596c5a86 (candidate 3e4078f656d5, eDP-1 only): 2x dpms off/on cycles during 4 x 1,985-case dEQP-VK.ssbo.* CTS runs (7,940/7,940 Pass), 0 new dmesg lines.
    • J713 (T8132, firmware 27.2) at 4654596c5a86 (candidate 90de523e9ed9, eDP-1 only): 0 failed units, 0 denials, 3x eDP-1 DPMS off/on cycles clean.
    • J716c (T6050) at e73cdf440c06 (CalDigit TS5 dual-4K240 dock on ATC2): eDP-1 (3456x2234@120), DP-1 (3840x2160@240), DP-4 (3840x2160@240); 2x full DPMS off/on cycles across all three monitors with 0 DCP crashes, 0 paired power-off failed, 0 IOMFB timeouts, 0 GPU submission errors.

dcp_peer_stop_v27() and dcp_peer_modeset_v27() previously checked only
channel depth before calling dcp_peer_probe_quiesce(), leaving
iomfb_queue_work() free to launch queued DRM swaps during the ~220 ms
A484(0)/msleep(100)/A362(0) sequence. Once dcp_peer_probe_quiesce()
cleared modeset_complete while peer_frames.active was still set, a
racing swap hit ERR_PTR(-EIO) in dcp_peer_start_second(), called
dcp_peer_swap_error(), and permanently marked the primary DCP crashed.
That broke subsequent A362(0) teardown, left the IOMFB transaction active
until its 10 s timeout, caused atomic commits to fail with -EINVAL, and
prevented the display processor from lighting a second external monitor
after replug.

In addition, iomfb_poweroff() called dcp_peer_stop_v27() without retry
while dcp_peer_unplug_v27() retried for only 100 ms, shorter than
dcp_peer_probe_quiesce()'s duration, so concurrent unplug and CRTC
power-off raced into -EBUSY.

Add an orthogonal iomfb.peer_paused gate (separate from sleep/DPMS
presentation_paused), pause new presentations and settle in-flight
transactions and callbacks around dcp_peer_stop_v27() and
dcp_peer_modeset_v27(), invalidate mode_state once a paired stop powers
the pipe down, and wait up to 1000 ms for a concurrent paired stop in
both dcp_peer_unplug_v27() and iomfb_poweroff().

Signed-off-by: Erik Bourget <[email protected]>
Mirror the new iomfb.peer_paused field in the host-test apple_dcp stub so
the extracted iomfb_queue_work() builds and runs cleanly.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 26, 2026 20:12
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at 6557cb21: not ready yet

Check Detail
CI at head running running: KUnit isp, KUnit jpeg, KUnit prores, KUnit scaler, KUnit macsmc, KUnit clpc
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at 6557cb21
Conflicts ok none
PR text ok Risk: two-way · M5 (T6050) and other firmware-27 external paired-DCP Macs; touches shared iomfb.c queue/retire helpers, dcpswapwatchdogcancel(), and dcpcompunbind() / dcpplatformremove() peer synchronization (all other Macs retain existing single-pipe behaviour). Revert: git revert -m 1 <merge-commit> (all state is in-memory driver runtime state; no persistent on-disk, ESP, or firmware state is modified).

Areas: area:display, area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

dcp_peer_record_retired_v27() previously dropped dcp_peer_lock holding
only get_device(peer->dev) before locking peer->iomfb.lock, allowing
concurrent driver unbind to devm-free peer while its struct device
remained alive.

Guard dcp_peer_record_retired_v27() with a shared rwsem read lock
drained on unbind/remove/shutdown after dcp_peer_forget(), and
revalidate the peer reservation under peer->iomfb.lock -> dcp_peer_lock
(preserving the driver's lock order) before mutating
peer->present_state_h17p. Extend tools/asahi/dcp-peer-shown-tests.py
with stale-reservation and concurrent-unbind tests.

Signed-off-by: Erik Bourget <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Changes requested at 7ff10c06ab58.

Blocker: The stalled-present retirement path calls dcp_swap_watchdog_complete() to cancel the watchdog. That helper also resets the retrain counter and calls dcp_takeover_adopt_proven(), which is reserved for a completed swap. An accepted present retired after losing its completion does not prove that the adopted mode scanned out. Cancel the watchdog without crediting a successful present and cover this with a stalled-present test.

The reported paired DPMS cycles and green host tests are useful. The physical dock replug stress and single-pipe regression row remain open.

iomfb_retire_stalled_present_h17p() previously called
dcp_swap_watchdog_complete() to cancel swap_watchdog_wq. That helper
also resets swap_watchdog_retrains and calls dcp_takeover_adopt_proven(),
crediting a completed scanout for a present whose completion never
arrived.

Add dcp_swap_watchdog_cancel() to cancel swap_watchdog_wq without
resetting retrain tracking or proving an adopted loader mode, use it in
iomfb_retire_present_locked_h17p(), and cover stalled-present retirement
and watchdog cancellation in dcp_dropped_swap_test.c.

Signed-off-by: Erik Bourget <[email protected]>
dcp_peer_stop_wait_v27() previously retried -EBUSY with an unconditional
usleep_range(5000, 6000) after checking time_after_eq(jiffies,
deadline), allowing a retry to start past the 1000 ms deadline and
polling across a racing paired stop or modeset.

Track active firmware-27 paired modeset and stop transitions under
dcp_peer_lock, wake dcp_peer_stop_wq when a transition finishes after
dropping dcp->dev, wait on dcp_peer_stop_wq with wait_event_timeout()
bounded by the remaining deadline when contended, and clamp any
uncontended transient -EBUSY wait so no retry starts at or after the
deadline. Add host tests in tools/asahi/dcp-peer-shown-tests.py for
concurrent stop serialization, failure-retry wakeup, and deadline
enforcement.

Signed-off-by: Erik Bourget <[email protected]>
…admission

An in-flight firmware-27 paired modeset holds peer_transition_active
while dcp_peer_probe_quiesce() clears peer_frames.active before
installing the new pair. Check peer_transition_active before treating
!peer_frames.active as terminal in dcp_peer_stop_v27_once() and
dcp_peer_stop_wait_v27(), including the wait_event_timeout() wake
predicates, so an unplug or power-off waits for the modeset to finish
and stops the new pair instead of sending HPD low mid-modeset.

Pass the absolute deadline into dcp_peer_stop_v27_once() and recheck it
after acquiring dcp_peer_lock before claiming peer_transition_active,
so blocking on dcp_peer_lock past expiry cannot admit a new stop attempt
or start settling the queue.

Extend tools/asahi/dcp-peer-shown-tests.py to cover mid-modeset
inactivity clearing and dcp_peer_lock contention across deadline expiry.

Signed-off-by: Erik Bourget <[email protected]>
dcp_peer_stop_v27_once() and dcp_peer_stop_wait_v27() performed
unlocked acquire loads of peer_transition_active and then
peer_frames.active before acquiring dcp_peer_lock or returning early on
retry exits. A concurrent paired modeset could claim
peer_transition_active and clear peer_frames.active inside
dcp_peer_probe_quiesce() between those two loads, letting a stop or
unplug return 0 mid-modeset and proceed to HPD low without waiting for
the replacement pair.

Drop the unlocked split checks at stop entry and retry exits so the
terminal !peer_transition_active && !peer_frames.active decision is
always made atomically under dcp_peer_lock before the admission
deadline check in dcp_peer_stop_v27_once().

Extend tools/asahi/dcp-peer-shown-tests.py to start a modeset between
the two observations and verify that dcp_peer_stop_wait_v27() waits for
completion and stops the replacement pair.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the watchdog-completion, paired-stop wait/deadline, mid-modeset quiesce race, lock-bounded retry admission, and atomic inactivity-check findings in 55bd177edf85, 01709acaef93, 30e47db14ffa, and a2af02271056 (on top of the unbind-synchronization fix in 4654596c5a86):

  • Added dcp_swap_watchdog_cancel() (drivers/gpu/drm/apple/dcp.c, drivers/gpu/drm/apple/dcp-internal.h) to cancel swap_watchdog_wq without resetting swap_watchdog_retrains or calling dcp_takeover_adopt_proven().
  • Switched iomfb_retire_present_locked_h17p() (drivers/gpu/drm/apple/iomfb.c) from dcp_swap_watchdog_complete() to dcp_swap_watchdog_cancel() when retiring a stalled present.
  • Added stalled_present_retired_test (drivers/gpu/drm/apple/dcp_dropped_swap_test.c) verifying that iomfb_retire_stalled_present_h17p() requires idle channels, cancels swap_watchdog_wq before the deadline without resetting swap_watchdog_retrains, settles the queue, ignores a subsequent late completion without crashing, and that dcp_swap_watchdog_cancel() leaves desktop->takeover_adopted set while dcp_swap_watchdog_complete() clears it.
  • Serialized firmware-27 paired modeset/stop transitions (peer_transition_active and peer_transition_seq under dcp_peer_lock), waking dcp_peer_stop_wq after releasing dcp->dev (dcp_peer_transition_end() in drivers/gpu/drm/apple/dcp-peer-runtime-v27.inc, drivers/gpu/drm/apple/dcp-peer-v26_6.inc, drivers/gpu/drm/apple/dcp-internal.h, drivers/gpu/drm/apple/dcp.c).
  • Updated dcp_peer_stop_v27_once() and dcp_peer_stop_wait_v27() (drivers/gpu/drm/apple/dcp-peer-runtime-v27.inc) to check !peer_transition_active && !peer_frames.active atomically under dcp_peer_lock (removing the unlocked split checks at stop entry and retry exits so a concurrent modeset that clears peer_frames.active mid-quiesce cannot trigger a false-success 0 return before the replacement pair stops) and to carry the 1000 ms deadline into dcp_peer_stop_v27_once(), rechecking it under dcp_peer_lock before claiming peer_transition_active (retry admission is bounded by the deadline while an already-admitted attempt can run past the deadline).
  • Extended test_peer_stop_wait() in tools/asahi/dcp-peer-shown-tests.py covering concurrent stop serialization, failure-retry wakeup, mid-modeset inactivity clearing, split-observation modeset races at stop entry and retry exits, dcp_peer_lock contention across deadline expiry, and deadline enforcement, and updated the PR body wording so retry-admission bounds and host-test/negative-control results are stated accurately.
  • Verified at a2af02271056: display.kunitconfig (167 passed, 1 skipped, 0 failed), topology.kunitconfig (209 passed, 1 skipped, 0 failed, including apple-dcp-dropped-swap 14/14), dcpext26-queue-tests.py and dcp-peer-shown-tests.py passed with --drop-v27-close and --drop-retire-sync negative controls caught, arm64 W=1 compile (dcp.o, iomfb.o), and checkpatch.pl --strict --git 30e47db14ffa..HEAD (0 errors, 0 warnings, 0 checks).

Hardware at a2af02271056 (default command line): J716c (batched candidate c3da8eed6f72) ran 6 eDP-1 DPMS off/on cycles (including during VRR toggling and pm_test=devices suspend/resume) with 0 DCP/IOMFB/watchdog errors and 0 paired power-off failed; J713 (batched candidate b3dbf237542b) ran 3x DPMS off/on and 3x s2idle on single-pipe eDP-1 with 0 DCP/IOMFB/watchdog/swap errors. The physical dual-external cable-pull row is still open.

@aurora-silicon-review ready for re-review at a2af02271056.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stalled-present retirement now cancels the watchdog without marking takeover proven or resetting the retrain count. The paired stop also inspects active frames and transitions under the same mutex and checks the retry deadline before admission. Code approved. The physical dual-external cable-pull row is still needed to qualify the paired path.

dcp_swap_watchdog_complete() now calls dcp_swap_watchdog_cancel() so
stalled-present retirement can cancel the pending watchdog without
resetting retrain tracking or marking takeover adopted. Extract
dcp_swap_watchdog_cancel() in the panel-adaptive-watchdog host test and
verify it leaves swap_watchdog_retrains and takeover_adopted intact.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the failing host-tests (apple-dcp panel-adaptive-watchdog) check in f872c293bc3f (host-test-only; all files under drivers/ and tools/asahi/ are byte-identical to a2af02271056):

  • tools/testing/selftests/drivers/gpu/apple-dcp/display.py: watchdog() now extracts dcp_swap_watchdog_cancel() alongside dcp_swap_watchdog_complete() (fixing the implicit declaration compile failure introduced when 55bd177edf85 split dcp_swap_watchdog_cancel() out) and verifies that dcp_swap_watchdog_cancel() cancels the pending work without resetting swap_watchdog_retrains or clearing takeover_adopted.
  • Verified at f872c293bc3f: panel-adaptive-watchdog passes under both clang and gcc, apple-dcp --group display passes (22/22 under HOSTCC=gcc), dcpext26-queue-tests.py and dcp-peer-shown-tests.py pass with negative controls (--drop-v27-close, --always-shown, --owner-only) caught, ./scripts/checkpatch.pl --strict --git a2af02271056..HEAD reports 0 errors, 0 warnings, 0 checks, and git diff --quiet a2af02271056..f872c293bc3f -- drivers/ tools/asahi/ confirms no kernel or tools/asahi changes since a2af02271056. The existing J716c (c3da8eed6f72) and J713 (b3dbf237542b) candidates are retained in the PR body as combined-build single-pipe (eDP-1) regression rows (they differ from a2af02271056 in shared driver files, including a paired-modeset guard on J716c), and the paired dual-external cable-pull / external hotplug row on qualifying code remains required under **Not yet:** before merge.

@aurora-silicon-review ready for re-review at f872c293bc3f.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at f872c293

Blockers:

  • Hosted CI at f872c293: All 22 checks (apple-build, host-tests, kunit, pr-text, readiness, KUnit suites) are currently queued (0 passing yet).
  • Paired dual-external hardware row: As noted under **Not yet:**, a paired dual-external cable-pull / external hotplug hardware row on qualifying code is still required before merge (the existing J716c/J713 rows are combined-build single-pipe eDP-1 regression runs).

Checked:

  • Audited commit f872c293 (tools/testing/selftests/drivers/gpu/apple-dcp/display.py, +6/-1); zero code blockers found, and all files under drivers/ and tools/asahi/ remain byte-identical to previously approved a2af0227.
  • Confirmed watchdog() in display.py now extracts dcp_swap_watchdog_cancel() alongside dcp_swap_watchdog_complete() and explicitly verifies that dcp_swap_watchdog_cancel() cancels pending work (cancelled == 2) while preserving swap_watchdog_retrains == 2 and takeover_adopted == true, whereas dcp_swap_watchdog_complete() clears both (cancelled == 3, !swap_watchdog_retrains, !takeover_adopted).
Evidence
  • tools/testing/selftests/drivers/gpu/apple-dcp/display.py: extracts 'void dcp_swap_watchdog_cancel(' and asserts the cancel vs complete behavioral distinction.
  • Local verification reported at f872c293bc3f: panel-adaptive-watchdog passes under both clang and gcc, apple-dcp --group display 22/22 (HOSTCC=gcc), dcpext26-queue-tests.py and dcp-peer-shown-tests.py pass with negative controls, checkpatch.pl --strict 0/0/0.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at f872c29 after the remaining integration requirements.

Checked: The only delta is a host fixture assertion. It checks that cancelling the swap watchdog preserves retry and takeover state until real completion clears them. The production code is unchanged from the reviewed commit. Keep the hosted and hardware requirements in place.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 29, 2026
Resolve the conflict in drivers/gpu/drm/apple/dcp-peer-runtime-v27.inc
with main's removal of the peer_scanout module parameter: the paired
stop keeps this branch's locked check of active frames and transitions,
and the peer_scanout checks this branch added are dropped along with the
parameter (dcp_peer_record_retired_v27() and the host-test mock).

Signed-off-by: Erik Bourget <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH at 21293a3

Checked: The merge honors main's removal of the peer_scanout parameter and retains the locked active-frame and transition check, bounded wait, and cancellation without proving takeover.

Blocker: Please complete the outstanding paired dual-external stop and resume evidence with the current merged source and hosted CI.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 29, 2026
@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at 6557cb21

Blockers:

  1. CI workflows are still queued at 6557cb21. Apple DRM KUnit, Host tests, and Apple build and KUnit are queued (pr-text and pr-readiness passed).
  2. Paired dual-external stop and resume hardware evidence remains open from the prior 21293a31 review.

Checked:

  • Forward merge 6557cb21 (MERGEABLE against main, 15 files, +1270/-46), clean merge of origin/main carrying the previously audited f872c293/21293a31 changes.
Evidence
  • Waiting for queued CI at 6557cb21 and the paired dual-external stop/resume hardware row.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 6557cb21bf91

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: - Forward merge 6557cb21 (MERGEABLE against main, 15 files, +1270/-46), clean merge of origin/main carrying the previously audited f872c293/21293a31 changes.

Follow-ups (not blocking): queued CI; paired dual-external stop/resume row

@erikwb

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Verified the current merged head 6557cb21bf91 locally and updated the PR body to reflect 6557cb21bf91:

  • Arm64 kernel builds (linux-j716c and linux-j713 profiles, LLVM=1) pass with 0 Apple DRM warnings or errors.
  • Apple DRM KUnit suites at 6557cb21bf91 pass (display.kunitconfig: 180 passed, 1 skipped, 0 failed; topology.kunitconfig: 211 passed, 1 skipped, 0 failed, including apple-dcp-dropped-swap 14/14 with stalled_present_retired_test).
  • Host tests at 6557cb21bf91 pass (apple-dcp --group display: 24/24 under HOSTCC=gcc, panel-adaptive-watchdog also passes under HOSTCC=clang; dcpext26-queue-tests.py and dcp-peer-shown-tests.py pass with --drop-v27-close, --always-shown, --owner-only, and --drop-retire-sync negative controls caught), and checkpatch.pl --strict is clean (0 errors, 0 warnings, 0 checks).
  • git merge-tree --write-tree against current main (a171afd2123f) is clean with 0 conflicts.

J716c (M5 Max, no external display attached) at 6557cb21bf91 (head merged with main dbfbced70b31) in a one-shot trial kernel: 4x eDP-1 DPMS off/on and a pm_test=devices suspend/resume cycle returned to 3456x2234@120, 0 GPU/MMU faults, 0 Oops/WARN, smoke and vkcube --c 240 --wsi wayland clean.

J713 (M4 MacBook Air, T8132, firmware 27.2, no external display attached) at 6557cb21bf91 in a standalone trial kernel (main + this head): eDP-1 connected and enabled, DPMS off/on x3 before and x2 after sleeps (each off false, each on true), s2idle x3 (suspend_stats success 1 -> 2 -> 3, fail 0), 0 failed units, 0 AppArmor denials, 0 Oops/WARN, and no new err line beyond the 2 main-base unprobed external display processor -ENODEV lines.

Remaining items before merge: completion of the queued hosted CI checks at 6557cb21bf91 and external-display/J716c s2idle hardware rows at 6557cb21bf91 (J716c physical dual-external cable-pull / external hotplug under active paired flips and s2idle, and J713 external-display hotplug/unplug).

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) labels Dec 1, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transition lock serializes the paired stop and modeset paths, and retirement cancels the watchdog without counting a delivered scanout. Apple build, host tests and DCP KUnit passed. The exact-head J716c and J713 single-pipe rows passed. The changed paired external stop and resume path still needs a live row.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 6557cb21bf91 (B2 merge train, 12-01 merge bar). Approval at this head: DjDeveloperr,aurora-silicon-review[bot]. Row: in the PR body at 6557cb2. CI: train L11 = main 684a4a4 + #3774 #3772 #3305: Apple build pass, KUnit dcp-fabric/dcp-topology/dcp-display/macsmc/asahi pass, host tests apple-dcp/dcp/g17 420 ok; hosted host-tests reds (ave-recovery-old + brcmf-ps-nap) are on main too Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 3330657 into main Dec 1, 2026
30 of 68 checks passed
@RyanTheTide
RyanTheTide deleted the fix/dcp-v27-peer-quiesce branch December 1, 2026 14:13
erikwb added a commit that referenced this pull request Dec 1, 2026
Combine the Type-C unplug present-retirement path with main's shared
iomfb_retire_present_locked_h17p() helper (from #3305):
- Return an explicit iomfb_retire_result (none, full, done) from
  iomfb_retire_present_locked_h17p() so watchdog, paired-stop, and
  unplug callers all share the same retirement, framebuffer-retention,
  watchdog-cancel (before iomfb_queue_advance()), and peer retired-ID
  recording path while preserving each caller's admission checks
  (deadline vs channels-idle) and full-table handling.
- Preserve paired-stop teardown when a firmware-27 paired transition
  is in flight (peer_transition_active) as well as when peer_frames.active
  is set.
- Keep both iomfb_pause_peer() and iomfb_queue_report_locked() in
  iomfb.c and both declarations in dcp-internal.h.

Signed-off-by: Erik Bourget <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants