Commit 6e8660e
committed
apple-drm: quiesce disconnected DCPs on suspend, fix resume crash
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.
When the drm suspend helper fails, iterate CRTCs and call
apple_rtkit_quiesce on disconnected DCPs so they stop generating IRQs.
On resume, re-boot them with apple_rtkit_boot and fire a hotplug event.
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>1 parent ce3b823 commit 6e8660e
1 file changed
Lines changed: 42 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | | - | |
113 | | - | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
442 | | - | |
| 444 | + | |
443 | 445 | | |
| 446 | + | |
444 | 447 | | |
445 | 448 | | |
446 | 449 | | |
| |||
627 | 630 | | |
628 | 631 | | |
629 | 632 | | |
| 633 | + | |
| 634 | + | |
630 | 635 | | |
631 | | - | |
632 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
633 | 651 | | |
634 | 652 | | |
635 | 653 | | |
636 | 654 | | |
637 | 655 | | |
638 | 656 | | |
639 | 657 | | |
| 658 | + | |
640 | 659 | | |
641 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
642 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
643 | 677 | | |
644 | 678 | | |
645 | 679 | | |
| |||
690 | 724 | | |
691 | 725 | | |
692 | 726 | | |
693 | | - | |
| 727 | + | |
694 | 728 | | |
695 | 729 | | |
0 commit comments