Skip to content

drm/apple: iomfb_m4: give startup A401 a 15 s deadline for ProMotion panels - #4006

Open
espentrydal wants to merge 1 commit into
aurora-silicon:mainfrom
espentrydal:fix/iomfb-m4-promotion-a401-deadline
Open

espentrydal wants to merge 1 commit into
aurora-silicon:mainfrom
espentrydal:fix/iomfb-m4-promotion-a401-deadline

Conversation

@espentrydal

Copy link
Copy Markdown
Contributor

What: Set a 15 s RPC deadline (r->deadline = jiffies + msecs_to_jiffies(15000)) around the one-shot fresh-session DCP startup call (A401) in dcp_m4_startup(), and clear r->deadline immediately afterward.

On ProMotion mini-LED panels (J604), fresh-session A401 loads APT M3 firmware and services >300 callbacks, taking ~4.90–5.01 s on hardware. This races directly against the default 5 s RPC deadline and intermittently fails with -ETIMEDOUT (-110), quarantining the internal DCP at boot.

Tested:

  • At PR head 040113b4218 (base 53732c475cb):
    • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
    • make LLVM=1 ARCH=arm64 W=1 drivers/gpu/drm/apple/iomfb_m4.o: 0 warnings, 0 errors.
  • Hardware (MacBook Pro 14" M4, apple,j604 / apple,t8132, OS/system fw 26.6.2, mBoot-18000.161.10, aura 1.0.0b18, Arch Linux ARM, 7.3.0-j604-dev+ carrying this commit): 6/6 consecutive cold boots and reboots completed A401 with 0 -110 timeouts or DCP quarantines (previously intermittently timing out at 5.0 s), kernel taint 8196, 0 failed units, 0 new kernel errors.

Risk: two-way door · M4 (t8132) DCP fresh-session startup in iomfb_m4.c. Only extends the one-shot startup A401 RPC deadline from 5 s to 15 s; all subsequent calls keep the default deadline.

Not yet: Standalone boot at this exact single-commit head 040113b4218 and hardware verification on J713/J715.

…panels

During fresh-session DCP startup (A401), ProMotion mini-LED panels such
as the J604 load APT M3 firmware and service >300 callbacks, taking
~4.90-5.01 s on hardware. This sits directly on the default 5 s RPC
deadline and intermittently times out with -ETIMEDOUT (-110),
quarantining the internal DCP at boot.

Give the one-shot startup A401 call a 15 s deadline and clear
r->deadline immediately after it returns.

Signed-off-by: Espen Trydal <espen@trydal.io>
@espentrydal
espentrydal requested review from a team as code owners December 2, 2026 22:21
@github-actions github-actions Bot added area:display 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 Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 040113b4: ready to merge

Check Detail
CI at head ok 4 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at 040113b4
Conflicts ok none
PR text ok Risk: two-way · M4 (t8132) DCP fresh-session startup in iomfbm4.c. Only extends the one-shot startup A401 RPC deadline from 5 s to 15 s; all subsequent calls keep the default deadline.

Areas: area:display
Merge: gh pr merge 4006 --merge (Owners and Core through the bypass: add --admin).

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

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

Approve at 040113b42187.

  • Scope: dcp_m4_startup() runs once per DCP (startup_started). It also runs for each 26.6.2 external DCP, so those get 15 s too, not only the panel.
  • Resume: not affected. The restart after idle or a deep sleep (iomfb_m4_ext_start()) and the display power-up (iomfb_m4_power_ungate()) don't send A401.
  • Other panels: no change in a normal boot, because the call returns when the firmware answers. J713 and J715 use this code. J773g, J623 and J624 have no 26.6.2 profile and never reach it.
  • Locks and a hung DCP: dcp->lock is held for the whole call, as before. A DCP that hangs without crashing now holds it, and its caller, for up to 15 s instead of 5 s. The callers are appledrm's component bind for the panel and the dcpext probe for each external DCP. If all three hang one after another, that is up to 45 s instead of 15 s. With appledrm as a module, only display setup waits and the boot framebuffer stays. If it's built in, the boot waits too. A crash or a quiesce still ends the wait at once, since dcp_m4_failed() completes r->received.
  • The deadline doesn't leak: nested calls inherit it, it goes back to 0 before the A457 call, and the idle worker takes the same lock before it sets its own.

Checked on the merge with main b902937859ec: iomfb_m4.o at W=1 has 0 warnings (CONFIG_DRM_APPLE_DCP_T8132 set by hand, as this was a build without Rust), and the full host tests pass on the series merged together (1028/1028). checkpatch --strict is clean.

Nit, no need to change: the code comment says 4.9 to 5.1 s, the commit message 4.90 to 5.01 s.

Please don't merge on the approval alone. Still owed at this head: 5 cold boots on the J604 with the A401 time from the log and no -110 or quarantined line, and one J713 or J715 boot with the panel up.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

J713 row at exact head 040113b4: PASS, boots with the panel up

J713 (MacBook Air M4, T8132, firmware 27.2). A = saved 7.3.0-aurora-fleet94; B = one-shot kernel built from this exact head with the fleet config (only DRM_APPLE_DISPLAY_KUNIT_TEST off, for main's current snd_pcm_lib_preallocate_free modpost break with DRM_APPLE=m/SND=m; it gates test code only), BLS one-shot entry, saved default unchanged.

A fleet94 B 040113b4
eDP-1 after boot connected, enabled, DPMS On, 2560x1664 connected, enabled, DPMS On, 2560x1664 (desktop up at 51 s)
backlight max 500, level 500 works max 500, level 500 works
one s2idle (rtcwake -d rtc1 -m freeze -s 20) resumes, panel on resumes, panel on
DCP errors (crash/timeout) / DART faults / WARN / Oops 0 / 0 / 0 / 0 0 / 0 / 0 / 0

No startup timeout or A401 deadline message was logged on B. The one failed unit on B is speakerguardd-v2-switchtest (non-fleet kernel), unrelated. Restored afterwards: saved fleet94, test kernel removed, SELinux Enforcing, 0 failed units.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed ready-to-merge Meets the merge policy: merge it (bot) labels Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Not merging this yet. The change reads right and the local checks are clean. One thing is missing: no boot so far has run this code on top of main's current DCP receive path. The ready-to-merge label doesn't know that.

  • The J713 boot above: it ran firmware 27.2. iomfb_m4_init() refuses anything but 26.6.2 before dcp_m4_startup(), and main drives the 27.2 panel with the firmware-27 backend. So it shows this kernel is fine on that Mac, but A401 was never sent from here.
  • The six J604 boots in the PR text: they ran j604-fixes. The patch is the same there (git patch-id 7cf7ddabe202 for this commit and for a080aa2c625d). But that branch starts at 515377db2a76, nine minutes before drm/apple: m4: power down idle external DCPs at runtime #3321 merged. drm/apple: m4: power down idle external DCPs at runtime #3321 reworked iomfb_m4.c: every IOMFB word of the A401 exchange now arrives through recv_message_early. dcp_m4_startup() and the RPC call and wait functions are unchanged. A row only carries over when the changed file didn't change in between, and here it did.

What lands it: the J604 boots from my review, at this head or on any branch with this commit on a main that has #3321. That is 5 cold boots with the A401 time from each log, the panel up, and no -110 or quarantined line. The J713 or J715 boot only helps on 26.6.2.

Hosted checks didn't run on this fork PR, so I ran them locally on the merge with main 2b2681932a5c (with #4004 applied too). iomfb_m4.c on main hasn't changed since.

Check Result
scripts/checkpatch.pl --strict 0 errors, 0 warnings, 0 checks
make LLVM=1 W=1 drivers/gpu/drm/apple/iomfb_m4.o (aurora_defconfig, Rust on) 0 warnings
run-host-tests.py --only apple-dcp 1/1
run-host-tests.py --only dcp-tunnel-prepare 18/18
run-host-tests.py --only t8132 4/4

Nothing to push. I'll merge this head once those boots are in.

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) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants