Skip to content

apple-drm: quiesce inactive DCPs on suspend, fix resume crash - #510

Open
areofyl wants to merge 3692 commits into
AsahiLinux:fairydustfrom
areofyl:fix/drm-dcp-suspend
Open

apple-drm: quiesce inactive DCPs on suspend, fix resume crash#510
areofyl wants to merge 3692 commits into
AsahiLinux:fairydustfrom
areofyl:fix/drm-dcp-suspend

Conversation

@areofyl

Copy link
Copy Markdown

drm_mode_config_helper_suspend returns -EINVAL when a secondary DCP (external display) is disconnected, which blocks the entire PM suspend path. Even if you make suspend return 0 anyway, the DCP RTKit firmware keeps running and generates mailbox IRQs that immediately wake from s2idle.

When the drm suspend helper fails, iterate CRTCs and call apple_rtkit_quiesce on inactive DCPs so they stop generating IRQs. On resume, re-boot them with apple_rtkit_boot and fire a hotplug event so the DRM state gets reconciled.

Also fixed the resume path. drm_mode_config_helper_resume crashes on NULL suspend_state if suspend failed, so check for that and fall back to a hotplug event instead.

Tested on M1 MacBook Air (J313) with USB-C display, fairydust 6.18.10. Still needs more stress testing with repeated plug/unplug + suspend cycles before taking this out of draft.

Loading
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20 participants

@areofyl@root3315@smfrench@fourdim@pavitrajha@shuaz-shuai@peaktwilight@dtor@benh-debian@maurer@Darksonn@opsiff@broonie@JohnsPony@sean-jc@mdroth@brgl@nathanchance@cjo-ggeo@devnexen