Uh oh!
There was an error while loading. Please reload this page.
apple-drm: quiesce inactive DCPs on suspend, fix resume crash - #510
Open
areofyl wants to merge 3692 commits into
Open
apple-drm: quiesce inactive DCPs on suspend, fix resume crash#510areofyl wants to merge 3692 commits into
areofyl wants to merge 3692 commits into
Conversation
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sign up for freeto 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.