Skip to content

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

Open
areofyl wants to merge 1 commit into
AsahiLinux:fairydustfrom
areofyl:fix/drm-dcp-suspend
Open

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

Conversation

@areofyl
Copy link
Copy Markdown

@areofyl areofyl commented May 31, 2026

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.

@areofyl areofyl force-pushed the fix/drm-dcp-suspend branch from d33be4e to 0b2b907 Compare June 1, 2026 00:14
@areofyl areofyl marked this pull request as ready for review June 1, 2026 00:19
@areofyl areofyl force-pushed the fix/drm-dcp-suspend branch from 0b2b907 to 6e8660e Compare June 1, 2026 00:23
@areofyl areofyl force-pushed the fix/drm-dcp-suspend branch from 6e8660e to 8faa278 Compare June 6, 2026 23:30
drm_mode_config_helper_suspend returns -EINVAL when a secondary DCP
(external display) is disconnected, which blocks the entire PM suspend
path. Even if suspend returns 0 anyway, the DCP RTKit firmware keeps
running and generates mailbox IRQs that immediately wake from s2idle.

In suspend_noirq, iterate CRTCs and call apple_rtkit_quiesce on
disconnected DCPs so they stop generating IRQs right before s2idle
entry. In resume_noirq, re-boot them with apple_rtkit_boot.

Also fix the resume path: drm_mode_config_helper_resume crashes on NULL
suspend_state when 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.

Signed-off-by: areofyl <areofyl@users.noreply.github.com>
@areofyl areofyl force-pushed the fix/drm-dcp-suspend branch from 8faa278 to 9a0b5c3 Compare June 7, 2026 16:49
Sign up for free to 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.

1 participant