Commit d33be4e
committed
apple-drm: quiesce inactive 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 inactive 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.1 parent ce3b823 commit d33be4e
1 file changed
Lines changed: 41 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 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | | - | |
113 | | - | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
442 | | - | |
| 443 | + | |
443 | 444 | | |
| 445 | + | |
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
| |||
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
| 632 | + | |
| 633 | + | |
630 | 634 | | |
631 | | - | |
632 | | - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
633 | 650 | | |
634 | 651 | | |
635 | 652 | | |
636 | 653 | | |
637 | 654 | | |
638 | 655 | | |
639 | 656 | | |
| 657 | + | |
640 | 658 | | |
641 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
642 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
643 | 676 | | |
644 | 677 | | |
645 | 678 | | |
| |||
690 | 723 | | |
691 | 724 | | |
692 | 725 | | |
693 | | - | |
| 726 | + | |
694 | 727 | | |
695 | 728 | | |
0 commit comments