apple-drm: quiesce inactive DCPs on suspend, fix resume crash#510
Open
areofyl wants to merge 1 commit into
Open
apple-drm: quiesce inactive DCPs on suspend, fix resume crash#510areofyl wants to merge 1 commit into
areofyl wants to merge 1 commit into
Conversation
d33be4e to
0b2b907
Compare
0b2b907 to
6e8660e
Compare
6e8660e to
8faa278
Compare
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>
8faa278 to
9a0b5c3
Compare
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.
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.