Skip to content

drm/apple: T6050: refuse deep sleep at .prepare where the firmware 27 display sleep is not known - #2070

Open
rolotrealanis98 wants to merge 5 commits into
aurora-silicon:mainfrom
rolotrealanis98:pr/t6050-deep-sleep-guards
Open

rolotrealanis98 wants to merge 5 commits into
aurora-silicon:mainfrom
rolotrealanis98:pr/t6050-deep-sleep-guards

Conversation

@rolotrealanis98

@rolotrealanis98 rolotrealanis98 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What: refuse a T6050 deep sleep at .prepare when the build's firmware 27 method table has no ID for one of the display sleep's calls, and refuse to start an endpoint that already runs but is not tracked for the sleep (-EPROTO) instead of starting it a second time.
Tested: J716s (firmware 27.3) at 7987e8f, row in the comments; KUnit, host tests and checkpatch --strict pass at that SHA (Testing below).
Risk: two-way door. T6050 DCP/DCPEXT on firmware 27 under the T6050 deep sleep. With main merged in (#2187), 27.0, its J714s copy and 27.2 keep their deep sleep; a table without an ID for a sleep call (27.3 today) is refused, and main already keeps such a processor out at admission, so the .prepare check is a consistency guard. The untracked-endpoint backstop is what this adds on top of main.
Not yet: a J714s 27.0 or 27.2 deep sleep at this head (I have no J714s).

Problem

A T6050 deep sleep (mem_sleep=deep) runs the firmware 27 display sleep on every DCP and DCPEXT admitted to the firmware 27 sleep transport (dcp_v27_sleep_selected()). Before #2187 that sleep sent its calls by their firmware 27.0 IDs, and admission did not look at the build's method table. A J714s on 27.2 or 27.3 was admitted, and its table gives several of those IDs to other methods or to none, so the sleep would have sent them anyway.

How it shows up, from the J716s (16-inch M5 Pro, firmware 27.3) on the base this was first written for, before #2124 decided admission per processor: a pm_test=devices deep sleep crashed the DCP in the device suspend. None of the J716s's endpoints were tracked for the sleep (sleep_v27_ep), so the sleep started the already running system endpoint 0x20 a second time. The firmware asserted, the call timed out after 1 s, the suspend returned -110, and the display stayed dark until a reboot.

Change

One commit, decided by the method table rather than by the board:

  • iomfb_v27_sleep_missing_method() names the first call of the display sleep that the selected table (dcp->v27_methods) has no ID for, NULL exactly when main's iomfb_v27_sleep_methods_complete() is true. The 27.0 table, its J714s copy and the 27.2 table carry them; the 27.3 table does not.
  • dcp_platform_prepare() refuses a firmware-driven sleep with -EOPNOTSUPP on a processor the display sleep would run on whose table does not carry it, before any device suspends, and logs the build and the first missing call. s2idle never reaches this check.
  • Two backstops: dcp_v27_sleep_prepare() refuses the same way, and dcp_v27_sleep_endpoints_open() returns -EPROTO rather than start an endpoint that already runs but is not tracked for the sleep. On an admitted processor every endpoint is tracked, so it does not trigger there.

Affected: T6050 DCP/DCPEXT on firmware 27 under the T6050 sleep. The J714s and the J716c on 27.0 and a J714s on 27.2 keep their deep sleep; a processor on 27.3 is refused (and on main is not admitted in the first place). No other SoC reaches this code.

No board or firmware-version check is added: the decision comes from the method table the driver already selects for the build, the same data iomfb_v27_missing_method() uses to decide whether a build may start at all. A build is admitted as soon as its table has an ID for every call the sleep sends.

Interaction with #2187 (main merged in at 7987e8f): that change makes the sleep send each build's own IDs and admits processors by iomfb_v27_sleep_methods_complete(). The merge keeps main's iomfb_v27_sleep_methods[] list and defines iomfb_v27_sleep_missing_method() over it, so the .prepare and dcp_v27_sleep_prepare() checks apply the same rule as admission: 27.2 stays admitted and 27.3 stays refused. The untracked-endpoint backstop is independent of it.

Testing

At 7987e8f: KUnit (display.kunitconfig, arm64, LLVM): 169 run, 168 passed, 1 skipped (needs CONFIG_UCLAMP_TASK), including dcp_firmware_27_sleep_methods. Host tests (tools/asahi/run-host-tests.py): 696/696, including display-sleep-merge-tests with the prepare-ignore-known negative control. checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks. drivers/gpu/drm/apple/ builds with W=1, no warnings, with CONFIG_APPLE_SOC_SLEEP on and off.

Not yet run

  • J714s on 27.0 or 27.2, default command line: a deep sleep still enters and resumes with the panel back, no refusal line; 0 AVC / 0 failed units / 0 new kernel errors.
  • The refusal itself on hardware: on main a processor whose table lacks a sleep call is not admitted, so the .prepare check cannot fire on any board today; the J716s row shows the head boots and s2idle is unaffected.
Related, not in this PR: the boot timer write on the J716s

On the J716s, t6050_sleep_boot_timer_off() oopses: its MSR S3_4_C15_C2_7 (SYS_APL_AGT_CTL_EL02) is an undefined instruction there (ESR 0x02000000, in the bound worker). The oops kills CPU0's high-priority kworker, so block I/O completions stop and the root file system hangs a couple of minutes later. Only the J714s and the J716c are admitted to the T6050 sleep today, so nothing here reaches that code on another board. Noting it for whichever board is admitted next.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T09:57:49.209727Z df8aaf5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@axboe

axboe commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

A data point for the 27.2 side of this, from the K116s (16" M5 Pro, 27.2): the firmware 27 display sleep does run to completion there, so 27.2 need not stay in the "not known" set. What it took, on top of the J714s 27.0 path:

  • Tags: A401 and up move by +50 on 27.2 (A484 → A534, A500 → A550, A442 → A492); A115 is unchanged. A492 rejects the 0xaa filler as index count and block size; zeros are accepted.
  • Secure mailbox: the internal DCP only acknowledges the IOP power state after /arm-io/dcp-exclave-mailbox is handshaken at bind and AP-idled between the main mailbox's AP and IOP idle. Without it the suspend times out as described here.
  • External engines: the four DCPEXT hand off and sleep with the same tags once the loader hands them over.

Details and logs are in #2075, the experiment branch is linked there. I have no 27.3 machine, so I can't say whether its tags follow the same shift.

@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Thanks, that's useful. I'd like to keep this PR as the guard and admit 27.2 separately:

  • This PR stops the crash for any T6050 firmware 27 DCP whose sleep calls aren't known. It stays needed for 27.3 and for anything newer.
  • 27.2 can leave the "not known" set when the work in T6050 K116s (27.2): deep sleep entry completes, the SoC does not sleep; DCP secure mailbox and DCPEXT handoff needed #2075 lands: the +50 tag shift, the zeroed A492 fields, and the dcp-exclave-mailbox handshake and AP idle. That should be one change. Admitting 27.2 without the secure mailbox would just move the failure to the IOP-idle timeout you describe. When you open it, I'll narrow v27_sleep_known to match, or rebase onto it, whichever you prefer.
  • 27.3: this J716s is on 27.3, so I can check whether the tags follow the same +50 shift there. That will be after Saturday (2026-11-21), when I'm back at the hardware. I'm also moving the J716s to the 27.2 stub for aura#274, so I can try your branch on a second 27.2 board if you push it.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

The fail-closed direction is right: refusing at .prepare (drivers/gpu/drm/apple/dcp.c:7528) stops the deep sleep before any device suspends, and the untracked-endpoint backstop at drivers/gpu/drm/apple/dcp-v27-sleep.inc:968 is a good generic check.

  1. The commit has no Signed-off-by, only agent trailers (a Co-Authored-By and a session link). Re-sign it with your own Signed-off-by and drop both trailers.
  2. dcp-v27-sleep.inc:408-419 (the comment above dcp_v27_sleep_known()) and the commit message quote the firmware's own assertion source file and line and its internal method names. Those are strings from the firmware. Describe the failure in our terms instead ("the firmware asserted on a second endpoint start and the call timed out").
  3. Not a blocker, but it shapes the next step. v27_sleep_known is set only inside the v27_j714s branch (dcp.c:6682), so whether the sleep is "known" is decided by board plus firmware version. The driver already keeps one method table per build (iomfb_v27_methods()) and checks a table for missing IDs (iomfb_v27_missing_method()). Set v27_sleep_known when the selected table has an ID for every method the sleep sends. Then 27.2, and 27.3 once its IDs are in its table, are admitted by data, not by a board check.
  4. This conflicts with drm/apple: J716c external displays and display sleep on firmware 27.2 #2187, which admits the J716c on 27.2 to the firmware 27 sleep transport (dcp_v27_sleep_transport_supported()) and reports a working 27.2 deep sleep there. With this PR that same sleep is refused at .prepare, because the J716c never sets v27_sleep_known. Point 3 fixes this if the 27.2 table carries the sleep's IDs; otherwise rebase onto drm/apple: J716c external displays and display sleep on firmware 27.2 #2187 and say which one wins.
  5. The branch no longer merges cleanly with integration/aurora; it needs a rebase.

HW row: J714s on 27.0 with this branch, default cmdline: a deep sleep still enters and resumes with the panel back (no refusal line); J716s on 27.3: the refusal line, no device suspended, s2idle unaffected; 0 AVC / 0 failed units / 0 new kernel errors on both.

Nit: the PR body ends with "Generated with Claude Code" and a session link; the last line should be Assisted-by: LLM (<Vendor>:<Model>).

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

This no longer applies to the current integration/aurora tip 110861f. Since it was opened, #2124 (fd5cc59) admitted the J716c on 27.0.0 to the firmware 27 sleep through a new v27_sleep_transport flag, and dcp_v27_sleep_selected() now requires that flag. A J716s on 27.3 therefore no longer takes the v27 sleep at all, but a J714s on 27.2 or 27.3 still does. Rebased as is, the J716c's merged deep sleep would be refused at .prepare, because v27_sleep_known is only set for the J714s 27.0 table. @rolotrealanis98 could you rebase and derive v27_sleep_known from the selected method table carrying every ID the sleep sends, as suggested in the 11-21 review? The comment and commit message should also describe the firmware assertion in our own words rather than quoting its source file, line and method names.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
… display sleep is not known

A T6050 deep sleep runs the firmware 27 display sleep on every DCP and
DCPEXT admitted to its transport (dcp_v27_sleep_selected()). That sleep
sends its calls by their firmware 27.0 IDs, and admission does not look
at the build's method table: a J714s on 27.2, whose table gives several
of those IDs to other methods or to none, takes the sleep and sends them
anyway.

On a J716s (27.3), before admission to the transport was decided per
processor, this sleep left the display dark until a reboot. None of its
endpoints were tracked for the sleep, so the sleep started the running
system endpoint a second time; the firmware asserted, the call timed out
after 1 s and the suspend failed with -ETIMEDOUT.

Refuse such a deep sleep where it starts, decided by the method table
rather than by the board:

- iomfb_v27_sleep_missing_method() names the first call of the display
  sleep that a build's table does not carry under the ID the sleep sends,
  NULL if it carries them all. The 27.0 table and its J714s copy carry
  them; the 27.2 and 27.3 tables do not.
- dcp_platform_prepare() refuses a firmware-driven (deep) sleep with
  -EOPNOTSUPP, before any device suspends, on a processor the display
  sleep would run on whose table does not carry it, and logs one line
  with the build and the first call it lacks. s2idle does not come here
  (no pm_suspend_via_firmware()).
- dcp_v27_sleep_prepare() refuses the same way if it is ever reached.
- dcp_v27_sleep_endpoints_open() refuses with -EPROTO when a ring already
  runs on an endpoint that is not tracked for the sleep, instead of
  starting that endpoint again. Every endpoint of an admitted processor
  is tracked, so it does not trigger there.

The J714s and the J716c on 27.0 keep their deep sleep. Another build is
admitted as soon as its table carries the sleep's calls under the IDs
the sleep sends; once the sleep sends each call by the build's own ID,
the check becomes whether the table has an ID for each call.

The apple-dcp-firmware KUnit suite checks the tables against the sleep's
calls, and display-sleep-merge-tests checks the refusal at .prepare.

Signed-off-by: rolotrealanis98 <[email protected]>

Signed-off-by: Rolando Trevino <[email protected]>
@rolotrealanis98
rolotrealanis98 force-pushed the pr/t6050-deep-sleep-guards branch from df8aaf5 to f0d63f6 Compare November 24, 2026 15:14
@rolotrealanis98
rolotrealanis98 requested review from a team and DjDeveloperr as code owners November 24, 2026 15:14
@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

@RyanTheTide thanks, reworked and rebased on main (83950d0), one commit:

  1. Re-signed with my own Signed-off-by; the Co-Authored-By and session-link trailers are gone.
  2. The code comment and commit message describe the failure in our terms (the sleep started an already running endpoint again, the firmware asserted, the call timed out), with no firmware file, line or method names.
  3. The PR body follows the template (What / Tested / Risk / Not yet) and carries no attribution line, per the rulebook.
  4. v27_sleep_known is gone. dcp_v27_sleep_known() asks the selected method table, with no board check: iomfb_v27_sleep_missing_method() checks that the table carries every call the sleep sends under the ID it sends. The J714s and the J716c on 27.0 keep their deep sleep; a J714s on 27.2 or 27.3 is refused at .prepare. No board or firmware-version check is added.

At f0d63f6: KUnit display suites 147/148 (1 skipped, none failed), host tests 505/505, checkpatch --strict clean, drivers/gpu/drm/apple/ builds with W=1 and no warnings with CONFIG_APPLE_SOC_SLEEP on and off.

On #2187: today the sleep sends 27.0 IDs, so a 27.2 table is refused here. Whichever lands second rebases. If #2187 lands first, I'll switch the .prepare and dcp_v27_sleep_prepare() checks to its iomfb_v27_sleep_methods_complete(), so 27.2 stays admitted and 27.3 stays refused; the untracked-endpoint backstop stays.

No hardware row yet at this head. On main the J716s no longer takes this sleep, so it can only show its deep sleep is unaffected; the refusal itself needs a J714s on 27.2 or 27.3. I don't have a J714s, so a run of the J714s 27.0 row would be very welcome.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) and removed merge-conflict Conflicts with the base branch (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at 68895bc7: not ready yet

Check Detail
CI at head ok 4 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 68895bc7
Conflicts ok none
PR text ok Risk: two-way · . T6050 DCP/DCPEXT on firmware 27 under the T6050 deep sleep. With main merged in (#2187), 27.0, its J714s copy and 27.2 keep their deep sleep; a table without an ID for a sleep call (27.3 today) is refused, and main already keeps such a processor out at admission, so the .prepare check is a consistency guard. The untracked-endpoint backstop is what this adds on top of main.

Areas: area:display, area:gpu

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

@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 7987e8f8d1fe.

Blocker: dcp_v27_sleep_endpoints_open() checks for an already-running untracked endpoint inside the same loop that initializes and starts endpoints. A later conflicting ID can return -EPROTO after earlier missing endpoints have already started, despite the comment saying refusal happens before anything is sent. Preflight the full endpoint set before the first start or show the unwind that restores it. Please cover a later conflicting ID after an earlier endpoint that would otherwise start.

Checked: The method-table predicate is a capability check, and CI currently passes. The supplied unsupported-build row is useful. Please add the requested supported-table J714s deep-sleep row to cover the success path.

dcp_v27_sleep_endpoints_open() checked each endpoint inside the loop
that starts them: that it exists, and that no ring the sleep does not
track already runs on it. An endpoint later in the set that failed
either check returned -ENODEV or -EPROTO after the ones before it had
already been initialized, started and opened, although the refusal was
meant to come before anything is sent.

Move both checks to dcp_v27_sleep_endpoints_check(), which walks the
whole set first; dcp_v27_sleep_endpoints_open() runs it before the first
endpoint is touched. A refusal now leaves every endpoint as it was. The
checks, their order and their errors are unchanged, and an endpoint the
sleep already tracks is still kept rather than refused.

tools/asahi/display-sleep-merge-tests.py runs the production function
with a conflicting or missing endpoint late in the set, after endpoints
that would otherwise start, and checks that none is initialized,
started or opened. A control with the checks back inside the start loop
fails that check, as do controls without the check, without the running
ring test, and refusing a tracked endpoint.

Signed-off-by: Rolando Trevino <[email protected]>
@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Fixed in 81a7880: the whole set is checked before any endpoint starts. dcp_v27_sleep_endpoints_check() now runs both checks (the endpoint exists; no untracked ring already runs on it) over every endpoint, and dcp_v27_sleep_endpoints_open() calls it before the first afk_init(). A refusal therefore leaves every endpoint as it was, so there is nothing to unwind. Endpoints the sleep already tracks are still kept, and the checks, their order and their errors are unchanged. A missing endpoint late in the set had the same ordering problem and is covered too. The comment now matches.

Test: tools/asahi/display-sleep-merge-tests.py runs the production function with 0x20 ready to start and 0x2b already running an untracked ring: -EPROTO with no endpoint set up, started or opened. It also covers a conflict on the last endpoint, a missing last endpoint, and a tracked endpoint that is kept. The same test on the previous code (checks inside the start loop) fails on "nothing started".

At 81a7880: KUnit display 168/169 (1 skipped, none failed), host tests 696/696, checkpatch --strict clean, and drivers/gpu/drm/apple/ builds with W=1 and no warnings with CONFIG_APPLE_SOC_SLEEP on and off.

On the supported-table J714s deep-sleep row: I don't have a J714s, so I can't run it. The J716s row at 7987e8f only shows that s2idle and boot are unaffected. A J714s 27.0 row at this head from someone who has one would be very welcome.

@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.

Code approved at the revised head. The endpoint check now completes for the whole set before the first start. I ran the exact-head host suite, and all 23 runs matched expectations, including a later untracked or missing endpoint leaving earlier endpoints untouched and the corresponding negative controls. Keep the hosted checks and supported-table J714s deep-sleep row as merge gates.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 27, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train review at 81a7880e: Verdict: merge after the J714s row. Checked: dcp_platform_prepare() now returns -EOPNOTSUPP for a deep sleep only when the build's 27.x table lacks an ID for one of the display sleep's calls. s2idle never reaches it (pm_suspend_via_firmware()), and since main already refuses such a processor at admission, this is the consistency guard you describe. dcp_v27_sleep_endpoints_check() validates the whole endpoint set before the first start, so a refusal sends nothing and changes nothing. iomfb_v27_sleep_missing_method() walks the same list as iomfb_v27_sleep_methods_complete(). One point: an error from .prepare aborts the whole suspend rather than degrading it. That's fine while admission already keeps 27.3 out of deep, but keep the two in lockstep (a test asserting missing_method == NULL iff methods_complete would pin it). Still needed: one J714s deep sleep on 27.0 or 27.2 at this head (the shared T6050 path must keep its deep sleep). <@422957901716652033>, could your J714s run it? No blocking finding in the code.

@erikwb erikwb 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.

Verdict: FINISH, then merge at 81a7880e9f25

Blockers: Add a passing deep-sleep and display-resume row at this head on a T6050 Mac with a supported display method table, plus a no-regression row on the other affected Mac where available. The J716s row predates the endpoint change and did not enter deep sleep.

Checked: The method check follows the table used for transport admission. An untracked or missing endpoint is caught before any endpoint starts. The new checks add no model gate, required knob or hardware safety constant. Build, KUnit, host tests and PR text passed, and the branch has no conflicts.

Evidence

81a7880e9f25 fixes the partial-start problem from the previous review. The endpoint check walks the whole set first. The host cases cover a later untracked ring and a missing last endpoint, with no ring initialized, started or opened in either case. The prepare hook is limited to firmware-driven sleep, and the supported-table test checks the same predicate used for admission.

@erikwb

erikwb commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

J716c (16-inch M5 Max, firmware 27.2) at 81a7880e9f25: boots, deep sleep is still admitted, displays come up as on the default kernel. The deep sleep and resume cycle can't be judged on this Mac right now: a deep sleep resets the machine a few seconds after entry at this head, and our default kernel, which does not carry this PR, resets the same way. So the reset does not come from this change, and the cycle is still open here.

Evidence

This head built on its own (7.3.0-ewb359+, no other changes), one-shot trial boots.

  • Boot (default command line plus watchdog.open_timeout=120, a recovery watchdog for test boots only): /sys/power/mem_sleep: [s2idle] deep; apple-sleep 280600000.sleep-controller: deep sleep available, not the default. No refusal line at boot, as expected for the 27.2 method table. eDP-1 3456x2234, external DP-1 and DP-4 3840x2160 (CalDigit TS5), Hyprland up. 0 DART faults; kernel errors are the same set as the default boot; failed units: aurora-peripherals.service only, same as the default boot.
  • Deep sleep, undocked (mem_sleep=deep, rtcwake -m mem -s 30): at this head the Mac reset about 5 to 10 s after entry, before the wake time, and came back on the default kernel. Same with the recovery watchdog (one try) and on the plain default command line with no watchdog running (one try). No suspend or resume line reached the journal.
  • Control, default kernel without this PR, same command: the same reset, 2 of 2 (once with a USB-C cable in the left-rear port, once with nothing attached).

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 29, 2026
dcp_platform_prepare() keeps main's early return for a display processor
already stopped for the sleep, ahead of the refusal of a deep sleep whose
display sleep the build's table does not carry. The merge-boundary test
gains main's case and checks that a stopped processor is not refused.

Signed-off-by: Rolando Trevino <[email protected]>
@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Merged main in (55c9433, normal push). One conflict, in dcp_platform_prepare(): main's early return for a display processor already stopped for the sleep (sleep_cold_stopped) now comes first, then this PR's refusal of a deep sleep whose display sleep the build's table does not carry. A stopped processor has no display sleep left to run, so it is not refused. tools/asahi/display-sleep-merge-tests.py takes main's case and checks exactly that (stopped + unknown table → 0, no invalidation, no cancellation): 23 compiled runs pass. dcp.o builds clean with W=1.

The deep-sleep row still has to come from a T6050 Mac with a supported display method table; the J716s (27.3, the table this PR refuses) can only show the refusal side, which its earlier row covers.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) labels 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 55c9433c

Blockers:

  • Hosted pull_request CI workflows (Apple build and KUnit, Apple DRM KUnit, pr-text) are action_required awaiting maintainer workflow approval for this fork PR.
  • Passing deep-sleep and display-resume hardware row on a T6050 Mac with a supported firmware-27 display method table (27.0 / 27.2) at 55c9433c is still open (as noted in the prior review and latest comment).

Checked:

  • Merge resolution at 55c9433c (drivers/gpu/drm/apple/dcp.c, tools/asahi/display-sleep-merge-tests.py): dcp_platform_prepare() cleanly keeps main's sleep_cold_stopped early return ahead of dcp_v27_sleep_known(dcp) so a cold-stopped display processor is neither invalidated nor refused; display-sleep-merge-tests.py exercises that exact sleep_cold_stopped && !v27_known case across all 23 compiled runs.
  • Preflight & method-table guards (dcp-v27-sleep.inc, iomfb_v27.c, dcp-firmware-test.c): dcp_v27_sleep_endpoints_check() validates the full v27_sleep_endpoints set before initializing or starting any endpoint (returning -ENODEV/-EPROTO without side effects), and iomfb_v27_sleep_missing_method() mirrors iomfb_v27_sleep_methods_complete() with KUnit coverage (dcp_firmware_27_sleep_methods).
Evidence
  • Diff scope: +212/-9 across 6 files; no code or merge-conflict defects found at 55c9433c.
  • Ready condition: Upgradeable to APPROVE once hosted fork CI passes green and a supported-table T6050 deep-sleep row clears at 55c9433c.

@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Could a maintainer approve the fork workflow runs at 55c9433 (Apple build and KUnit, Apple DRM KUnit, pr-text show action_required)? The merge-boundary test and a W=1 build of dcp.o pass locally (comment above).

@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 55c9433c3470

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: - Merge resolution at 55c9433c (drivers/gpu/drm/apple/dcp.c, tools/asahi/display-sleep-merge-tests.py): dcp_platform_prepare() cleanly keeps main's sleep_cold_stopped early return ahead of dcp_v27_sleep_known(dcp) so a cold-stopped display processor is neither invalidated nor refused; display-sleep-merge-tests.py exercises that exact sleep_cold_stopped && !v27_known case across all 23 compiled runs.

  • Preflight & method-table guards (dcp-v27-sleep.inc, iomfb_v27.c, dcp-firmware-test.c): dcp_v27_sleep_endpoints_check() validates the full v27_sleep_endpoints set before initializing or starting any endpoint (returning -ENODEV/-EPROTO without side effects), and iomfb_v27_sleep_missing_method() mirrors iomfb_v27_sleep_methods_complete() with KUnit coverage (dcp_firmware_27_sleep_methods).

Follow-ups (not blocking): fork CI approval, T6050 27.x deep-sleep/display-resume row

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 1, 2026
Main's dcp_platform_prepare() now runs dcp_v27_dpms_prepare() before the
deep-sleep path; for a deep sleep it can power the display pipe on and
set v27_dpms_pm_suspend, which only .complete undoes, and a device whose
.prepare fails gets no .complete. The refusal of a deep sleep whose
display sleep the build's table does not carry therefore comes first,
then main's DPMS prepare, then the deep-sleep invalidation. The
merge-boundary test counts the DPMS prepare and checks that a refused
sleep never reaches it.

Signed-off-by: Rolando Trevino <[email protected]>
@rolotrealanis98

Copy link
Copy Markdown
Contributor Author

Merged main in again (68895bc, normal push). Main's dcp_platform_prepare() now calls dcp_v27_dpms_prepare() before the deep-sleep path; for a deep sleep it can power the display pipe on and set v27_dpms_pm_suspend, which only .complete undoes, and a device whose .prepare fails gets no .complete. So the refusal of a deep sleep the build's table does not carry now comes first, then main's DPMS prepare, then the deep-sleep invalidation. tools/asahi/display-sleep-merge-tests.py counts the DPMS prepare and checks that a refused sleep never reaches it (with the two calls swapped the test fails); 23 compiled runs pass. dcp.o builds clean with W=1.

J716s row at 68895bc:

J716s (MacBook Pro 16-inch, M5 Pro, firmware 27.3), test kernel 7.3.0-g0c0e8adb3eb0 = the J716s daily kernel
with this PR at 68895bc7 (git diff <main base>..68895bc7 for drivers/gpu/drm/apple applied, the daily's own copy
reverted; that base has no DPMS prepare, so dcp_platform_prepare() is the refusal + invalidation), booted through aura:
- boot: PASS, slot primary, 0 failed units, internal panel 3456x2234@120 and HDMI 2560x1600@165 up, 0 DCP crash/timeout lines,
  0 WARNING/BUG/Oops
- deep-sleep refusal lines at boot: 0; /sys/power/mem_sleep: [s2idle]
- s2idle (pm_test=devices): suspend_stats success 1 / fail 0, resumed, both displays modeset back, network back, 18 CPUs online
- deep: not offered on this chain; the J716s on 27.3 is not admitted to the firmware 27 sleep transport, so .prepare's refusal
  is the expected outcome there and its host test covers it

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

This branch has not been deployed

No deployments
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:m5 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants