Commit b74560d
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.
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>1 parent b94beb5 commit b74560d
1 file changed
Lines changed: 60 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
627 | 631 | | |
628 | 632 | | |
629 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
630 | 673 | | |
631 | | - | |
632 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
633 | 683 | | |
634 | 684 | | |
635 | 685 | | |
| |||
638 | 688 | | |
639 | 689 | | |
640 | 690 | | |
641 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
642 | 695 | | |
| 696 | + | |
| 697 | + | |
643 | 698 | | |
644 | 699 | | |
645 | 700 | | |
646 | 701 | | |
647 | 702 | | |
648 | 703 | | |
| 704 | + | |
| 705 | + | |
649 | 706 | | |
650 | 707 | | |
651 | 708 | | |
| |||
0 commit comments