Repository navigation
Conversation
5924bd0 to
0184115
Compare
|
Thanks for this; the 7/7 and 6/6 sleep runs with both ports in use are convincing. One small point. We select protocol-level behaviour for every device that speaks the protocol, not for the chip where it was seen. In Could you drop the |
A dcpext's firmware sets its link rate to 0 when its HPD goes low, from within the set_hpd(0) call. In DP alt mode the rate goes to the ATC PHY, whose configure may refuse it (-EOPNOTSUPP) once the PHY has left DP mode, as the T8132 ATC PHY does when the display is released for a deep sleep. The refusal goes back to the firmware, which then waits on its own call and answers nothing else: the set_hpd(0) and the release_display after it time out, and the next connect does too. A link going down on a PHY that is out of DP mode is down already: answer the rate 0 as done, whichever DCP asks. No other PHY driver refuses a rate 0 with -EOPNOTSUPP: they take the link down, or fail with another error that goes back as before. Assisted-by: LLM Signed-off-by: Bartosz Nitka <niteria@gmail.com>
A deep sleep powers a T8132 dcpext down whole (iomfb_m4_ext_stop()), and its firmware starts again from reset after it. Firmware that starts with its DPTX port still connected brings the link up on hardware the sleep reset, and crashes (an SError) with any display attached. So in its deep-sleep suspend, before A500 while its firmware still runs, the display is released as an unplug releases it (HPD low, then dcp_dptx_disconnect()) and its crossbar output is parked. The cable stays connected: after the restart the route is unparked and the type-C work connects the display again, as for a plug. A suspend that fails after the release connects it again at once. A release call that timed out is never answered by the firmware that starts from reset: it is dropped once the firmware is stopped, so that the connect after the wake does not wait for it. DRM does not see that release and reconnect. From the release until the replay of its state at PM_POST_SUSPEND, the connector is held: it stays connected, its modes are those of the link it had (the link's capacity is kept at the release; its rate is 0 meanwhile), and its hotplugs wait. Only an output that took the hold at PM_SUSPEND_PREPARE is held, as its PM_POST_SUSPEND is what ends the hold. The replays wait for their displays to be connected again (each one's D575 and its sink's timing catalog), together and 3 s at most, before any takes the modeset locks, so that each modeset finds its link up. A display unplugged during the sleep ends its wait as soon as that is known (no cable at the reconnect, or the type-C unplug after it). When the replay is done (for an output that was not replayed, when the wait is over), the hotplug held meanwhile goes out. The release's own HPD low and rate 0 are among the hotplugs held, so one goes out after every such sleep, and the compositor finds what the sleep changed: a display gone, also one whose CRTC was off, or a new link or sink. A replay that fails sets the link status BAD and sends the hotplug as well. Assisted-by: LLM Signed-off-by: Bartosz Nitka <niteria@gmail.com>
0184115 to
3e2fe31
Compare
|
Done in 3e2fe31: the No firmware gets that error for a rate 0 today, so none can rely on it: the T8132 ATC PHY is the only PHY driver that returns -EOPNOTSUPP for one. The others:
So on the M1 Pro, M2, M4 Pro and A18 Pro the firmware gets the same answers as before, and the no-regression rows there would confirm it. On T8132 the change is a no-op, so the Air runs stand. Host tests (full run): 425/425 on each commit. |
|
Thanks for 3e2fe31 and for the per-PHY survey of what a rate-0 request returns; that makes the no-op on the other machines easy to follow. This reads right to us. |
Deep sleep with an external display attached crashes the M4 (T8132) external DCP on its restart after the wake, and the display stays dark until a reboot. This keeps the display across the sleep: it is released before the DCP powers down and connected again after, with the DRM connector held meanwhile so the compositor sees no unplug.
The crash
A deep sleep stops a dcpext and powers it down whole (eb34e77); its firmware starts from reset after the wake. With its DPTX port still connected and a display attached (4K@30 or 1080p@60, USB-C to HDMI, either port), the restarted firmware crashes at once: RTKit "co-processor has crashed", an SError with the async error at 0x286100688 every time. The enable then fails with -67, DPTX calls time out, and a replug doesn't bring the display back. With nothing attached the restart is clean.
The change
The release is in the DCP's suspend, not the PM_SUSPEND_PREPARE notifier: there atcphy_suspend refuses the sleep with -EBUSY.
Tested
J713 (MacBook Air M4), integration/aurora a7dd26e + #2166 (EDID) + these commits as an out-of-tree appledrm.ko, dcpext handover (chosen.asahi,j713-dcpext=1, atcphy0/1 apple,dp-alt-mode), Aura b13.1, a Samsung 4K (3840x2160@30) and a 1080p display over USB-C to HDMI adapters, RTC wake (rtc1):
These runs had the rate-0 rule limited to T8132 dcpexts; on the Air that is the same as without the limit.
Based on cb57d4a, the integration/aurora merge before #2135, since with #2135 the M4 Air doesn't deep-sleep. It merges cleanly onto current integration/aurora and onto #2166, and doesn't depend on it.
Host tests (tools/asahi/run-host-tests.py, full run): 425/425 on each commit and on the base.
🤖 Generated with Claude Code