Repository navigation
drm/apple: don't latch ->crashed when the poweroff clear swap times out - #5
Closed
Chromatischer wants to merge 1 commit into
Closed
Chromatischer wants to merge 1 commit into
Chromatischer wants to merge 1 commit into
Conversation
iomfb_poweroff() submits a clear swap and waits 50 ms for it. When the display is a Type-C output that has already been unplugged, the firmware has nothing left to swap to and swallows the request: IOMFB: swap_submit_dcp: swallowed swap ID 1348 as fControllerPowerState is 0 for External Display The completion misses its window, the wait times out, and ->crashed is set with nothing logged. dcp_crtc_atomic_check() then returns -EINVAL for every commit on that CRTC, so the next plug trains the link, reads a 256-byte EDID and a full mode list, and reports the connector as connected -- while the screen stays dark. The compositor walks every mode down to 640x480, has each one rejected, and gives up. Only a reboot clears it. One unplug is enough to reach that state. The DCP has not crashed: a real firmware crash arrives through dcp_rtk_crashed(), which sets the same flag and says so. A swallowed clear swap on the way down is the ordinary unplug. Warn instead, and keep the early return. Carrying on into iomfb_abort_swaps_dcp() and setPowerState(0) leaves less state behind and matches what the setPowerState(0) wait further down already does on its own timeout, so it was tried first -- but for a display that is already gone it is worse. The dptx HPD deassert then fails: apple-dcp 271c00000.dcp: failed to deassert Type-C DPTX HPD: -110 and the next plug borrows the route and reports connected=0 without ever asserting HPD, so the display does not come back at all. The early return is load-bearing. Tested on J313 (M1 MacBook Air, t8103) with a Type-C to HDMI adapter. Plug, unplug, replug and suspend/resume all bring the display back; before, one unplug left it enumerated but unusable for the rest of the boot. Signed-off-by: Chromatischer <[email protected]> Assisted-by: Claude:claude-opus-5
cb2206
pushed a commit
to cb2206/linux
that referenced
this pull request
Oct 5, 2026
…mailbox-hardening soc: apple: rtkit/mailbox hardening from aurora-wip
RyanTheTide
added a commit
that referenced
this pull request
Oct 17, 2026
Bring the 7.2.10 assembly to the tree of the canonical top-up #5 assembly 1c824ed, stacked on top-up #4 5043778 so that it is a fast-forward of the published branch. The second parent is that canonical assembly; the tree is identical to it. Ported from aurora-wip, each with cherry-pick -x and its original author: - #338 tipd lost IRQ (5): never leave CD321x interrupt events unacknowledged, recover from a failed partner identity read, keep SN201202x events unhandled while it sleeps and wake it when suspend fails, and the KUnit race fix of the IRQ test (170-usb). - #339 Touch ID verify retry (2): say why the sensor status after registration was unusable, and retry a failed sensor bring-up before a verify (100-sep). - #340 USB and Bluetooth wake v4.1 (30): AIC wake (010-soc); xHCI, DWC3 and hub suspend-to-idle wake with their KUnit tests (170-usb); MT7932 Bluetooth wake and MSI wake for Apple PCIe (080-radio); the apple-dcp DWC3 wake model (200-dcp); the tools/aurora-wake regression tools (900-config-tooling). - #341 apple-dcp selftests for the tipd lost-IRQ helpers (200-dcp). - batch1 backlog: rust-clippy (4; 070-audio, 210-gpu), boot-warnings (3; 200-dcp), and the 4 harden-all commits not yet carried (010-soc qspi resume, 070-audio AOP wrapped-entry test, 200-dcp start completion). kunit-parsers, spi-apple-cs and the other 34 harden-all commits were already in the topics, including the AOP ring fix that top-up #4 brought; it is not duplicated. Not ported: 3132675, superseded on 7.2.10 by b69728b ("selftests: apple-dcp: Follow the 7.2.10 driver boundaries"). Adaptations, each with a [ryan: ...] note in its commit: - the new tipd KUnit tests take the CD321x and SN201202x data from the exported tipd_hw_variants[] table of 7.2.10; - the #341 lifecycle.py import also keeps ATC_POST_TUNABLE; - drm/asahi statistics style without the driver.rs part, which 7.2.10 already has; - the Rust doc example refresh only for KVec and Drain: iosys_map.rs, the old IoMem example and declare_flags_type!() are gone in 7.2.10; - "Do not arm the core interrupt for wakeup" split between 170-usb and 200-dcp. New: 11e0ce6 ("usb: typec: tipd: cd321x: Don't race the resume read in the sleep retry test"). Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide
added a commit
that referenced
this pull request
Oct 17, 2026
Bring the 7.2.10 assembly to the tree of the canonical top-up #6 assembly, stacked on top-up #5 f34b5ae so that it is a fast-forward of the published branch. The second parent is that canonical assembly; the tree is identical to it. Ported from aurora-wip, each with cherry-pick -x and its original author: - #347 KUNIT_ALL_TESTS=m modpost (3): the xHCI platform tests call the interrupt handler through the HC driver (170-usb), and module descriptions for the CD321x PM tests (170-usb) and the drm/apple KUnit test modules (200-dcp). - #349 the CD321x IRQ test waits for the resume read before checking its retry (170-usb). - #350 trusted keys keep a source that registers before init_trusted() (100-sep). Its test commit is already carried as 76d70cc and is not duplicated. - #351 SEP hwrng: recover the entropy exchange after a request times out, and hold entropy requests while the system sleeps (100-sep). - #352 SEP SBIO: take a reply header only once it has landed, and poison it again once read and before each host send (100-sep). Adaptations, each with a [ryan: ...] note in its commit: - trusted-type.h: context only, the declaration goes above the 7.2.10 CONFIG_TRUSTED_KEYS_DEBUG block; - the CD321x IRQ test takes its data from tipd_hw_variants[], and its retry loop replaces the 7.2.10-only fix of the same race in 11e0ce6. The Co-Authored-By lines of the three #347 commits are dropped. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Oct 24, 2026
This was referenced Oct 31, 2026
This was referenced Nov 1, 2026
This was referenced Nov 5, 2026
This was referenced Nov 17, 2026
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unplugging a Type-C display once kills that output until reboot. This is the
-EINVAL-after-replug that the stale DPTX link PR describes on J416c and leaves unexplained. It is notpossible_crtcs.The chain
iomfb_poweroff()submits a clear swap and waits 50 ms. On unplug the display is already gone, so the firmware swallows it:The completion misses its window and
iomfb_template.c:939setsdcp->crashed = true— silently.dcp_crtc_atomic_check()then returns-EINVALfor every later commit on that CRTC.The replug looks healthy the whole way down:
statusreadsconnected, EDID is 256 bytes, 31 modes are listed, the compositor names the monitor — and then every atomic commit is rejected. 141 in one session, walking the mode list down to 640x480 before giving up. Routing is fine;drm.debug=0x14shows the connector picking the right encoder and CRTC:Hard to find because nothing is logged. The other assignment,
dcp_rtk_crashed(), prints "DCP has crashed"; this one prints nothing.The fix
Warn instead of latching the flag. A real firmware crash still arrives through
dcp_rtk_crashed().What was tried and rejected
Carrying on into
iomfb_abort_swaps_dcp()andsetPowerState(0)rather than returning early leaves less state behind, and matches what thesetPowerState(0)wait further down the same function already does on its own timeout. It was built and tested — it is worse. For a display that is already gone the dptx HPD deassert then fails:and the next plug borrows the route and reports
connected=0without ever asserting HPD. The display does not come back at all; 20 s later the connector was stilldisconnected. The early return is load-bearing, and the commit message says so.Tested
J313 (M1 MacBook Air, t8103) on
aurora-wip@ 673d2a6, Type-C to HDMI adapter, LG 4K at 3840x2160@30.connected / enabled / dpms=On, image on screenRejected atomic commits went from 141 to 0. The one remaining
failed to commitin the compositor log is anEBUSYpage flip that predates this bug and is unrelated. Nounexpected busy command channeland nofailed to deassertin any run.Note for anyone reproducing this on M1
Two device-tree things had to be sorted out first, neither of them part of this PR:
t8103-jxxx.dtsideclaresusb4-0-acio/usb4-0-nhi/usb4-0-pcie/usb4-0-pcie-adapter, but m1n1 v1.6.1 looks upusb4_%d_rc/usb4_%d_nhi/usb4_%d_pcie/usb4_%d_pcie_adapter(stringson the shipped binary). Every lookup misses, noapple,tunable-*reaches thecionode,thunderbolt-apple-aciofails probe onUnable to load rc tunable, and becausecd321x_probe()waits on a Thunderbolt switch that is only registered past that point, both PD controllers sit indevices_deferredforever. With no Type-C ports at all, plugging a display does nothing.t8112-jxxx.dtsi,t600x-j314-j316.dtsiandt600x-j375.dtsicarry the same hyphen-only aliases.PCIe-C tunnel disabled: m1n1 handoff is not initializedon both ports, which cannot be worked around from the device tree. Dock testing was not attempted.Happy to raise either separately.