Macbook Pro 11,4 待机和关机挂起

Macbook Pro 11,4 待机和关机挂起

几周前,我刚刚成功将 Ubuntu Desktop 14.04 和 Mac OS 10.10.4 (Yosemite) 在我的 2015 年中期 (11,4) Macbook Pro 上实现双启动。由于某种原因,机器在关机和待机时挂起。具体来说:

  • 告诉机器关机(例如,sudo poweroff、sudo shutdown now 等)会导致正常关机程序,直到最后一行“系统现在将停止”。一旦到达这里,系统就会冻结,我让它关闭的唯一方法是手动按住电源按钮几秒钟进行硬关机。

  • 让机器待机会导致它黑屏并且无响应。恢复的唯一方法是按住电源按钮几秒钟进行硬关机。将机器恢复后,我在恢复时收到“检测到系统错误”通知。

一些相关说明:

  • MBP 运行集成的英特尔 Iris Pro 和 AMD Radeon R9 M370X 显卡,我使用的是 fglrx-updates 的专有驱动程序。我从早期版本的 Ubuntu 中其他看似相关的案例中了解到,问题源于专有显卡驱动程序。但是,切换回开放的 XOrg 驱动程序并 apt-get 清除 fglrx-updates 并不能解决这两个问题。

  • 如果我尝试休眠而不是待机,显示屏就会返回并在几分钟后返回到桌面(就像它从休眠状态唤醒一样)。

  • 重启工作正常。事实上,我可以从 Ubuntu 上彻底关闭机器的唯一方法是重启并从 rEFInd 关机或启动到 OS X 并关机。

我不确定发布哪些日志最有意义(这是我第一次提问),但如果有人有任何见解,我会很高兴尽快发布正确的日志。

更新 1:将其置于待机状态实际上会导致屏幕关闭,然后几乎立即打开,然后再次关闭并挂起。我返回 Ubuntu 时收到的系统错误如下:

ProblemType: KernelOops
Annotation: This occured during a previous suspend and prevented it from resuming properly.
Architecture: amd64
Date: Thu Sep 10 22:50:55 2015
DistroRelease: Ubuntu 14.04
ExecutablePath: /usr/share/apport/apportcheckresume
ExecutableTimestamp: 1439395460
Failure: suspend/resume
InterpreterPath: /usr/bin/python3.4
Package: linux-image-3.19.0-25-generic 3.19.0-25.26~14.04.1

我还在下面附上了睡眠日志。

Initial commandline parameters: 
Thu Sep 10 22:50:05 EDT 2015: Running hooks for suspend.
Running hook /usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend:
/usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/000record-status suspend suspend:
/usr/lib/pm-utils/sleep.d/000record-status suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/00logging suspend suspend:
Linux fruit 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Module                  Size  Used by
nvram                  16384  0 
msr                    16384  0 
btusb                  40960  0 
joydev                 20480  0 
bcm5974                20480  0 
pci_stub               16384  1 
vboxpci                24576  0 
vboxnetadp             28672  0 
vboxnetflt             28672  0 
vboxdrv               450560  3 vboxnetadp,vboxnetflt,vboxpci
xt_CHECKSUM            16384  1 
iptable_mangle         16384  1 
ipt_MASQUERADE         16384  1 
nf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE
iptable_nat            16384  1 
nf_conntrack_ipv4      16384  1 
nf_defrag_ipv4         16384  1 nf_conntrack_ipv4
nf_nat_ipv4            16384  1 iptable_nat
nf_nat                 24576  2 nf_nat_ipv4,nf_nat_masquerade_ipv4
nf_conntrack          106496  4 nf_nat,nf_nat_ipv4,nf_nat_masquerade_ipv4,nf_conntrack_ipv4
xt_tcpudp              16384  5 
bridge                110592  0 
stp                    16384  1 bridge
llc                    16384  2 stp,bridge
iptable_filter         16384  1 
ip_tables              28672  3 iptable_filter,iptable_mangle,iptable_nat
x_tables               36864  6 xt_CHECKSUM,ip_tables,xt_tcpudp,ipt_MASQUERADE,iptable_filter,iptable_mangle
applesmc               20480  0 
input_polldev          16384  1 applesmc
x86_pkg_temp_thermal    16384  0 
intel_powerclamp       20480  0 
coretemp               16384  0 
kvm_intel             151552  0 
kvm                   479232  1 kvm_intel
brcmfmac              278528  0 
brcmutil               16384  1 brcmfmac
lpc_ich                24576  0 
cfg80211              524288  1 brcmfmac
bdc_pci                16384  0 
mei_me                 20480  0 
mei                    90112  1 mei_me
sbs                    16384  0 
sbshc                  16384  1 sbs
apple_gmux             16384  0 
mac_hid                16384  0 
snd_hda_codec_cirrus    20480  1 
snd_hda_codec_generic    69632  1 snd_hda_codec_cirrus
snd_hda_codec_hdmi     53248  1 
snd_hda_intel          32768  10 
snd_hda_controller     32768  1 snd_hda_intel
snd_hda_codec         143360  5 snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller,snd_hda_codec_cirrus
snd_hwdep              20480  1 snd_hda_codec
fglrx               12460032  127 
snd_pcm               106496  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
snd_seq_midi           16384  0 
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            32768  1 snd_seq_midi
snd_seq                65536  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device         16384  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              32768  2 snd_pcm,snd_seq
snd                    86016  31 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_hda_codec_cirrus
apple_bl               16384  1 apple_gmux
amd_iommu_v2           20480  1 fglrx
soundcore              16384  2 snd,snd_hda_codec
shpchp                 40960  0 
bnep                   20480  2 
rfcomm                 69632  0 
bluetooth             491520  11 bnep,btusb,rfcomm
binfmt_misc            20480  1 
parport_pc             32768  0 
ppdev                  20480  0 
lp                     20480  0 
parport                45056  3 lp,ppdev,parport_pc
nls_iso8859_1          16384  1 
dm_crypt               24576  1 
hid_generic            16384  0 
hid_apple              16384  0 
crct10dif_pclmul       16384  0 
crc32_pclmul           16384  0 
ghash_clmulni_intel    16384  0 
aesni_intel           172032  2 
aes_x86_64             20480  1 aesni_intel
lrw                    16384  1 aesni_intel
gf128mul               16384  1 lrw
glue_helper            16384  1 aesni_intel
ablk_helper            16384  1 aesni_intel
cryptd                 20480  4 ghash_clmulni_intel,aesni_intel,ablk_helper
uas                    24576  0 
usb_storage            69632  1 uas
ahci                   36864  3 
usbhid                 53248  0 
libahci                32768  1 ahci
hid                   110592  3 hid_generic,usbhid,hid_apple
video                  20480  1 apple_gmux
             total       used       free     shared    buffers     cached
Mem:      16306696    1188872   15117824      22748      47276     365684
-/+ buffers/cache:     775912   15530784
Swap:      4194300          0    4194300
/usr/lib/pm-utils/sleep.d/00logging suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/00powersave suspend suspend:
/usr/lib/pm-utils/sleep.d/00powersave suspend suspend: success.

Running hook /etc/pm/sleep.d/10_grub-common suspend suspend:
/etc/pm/sleep.d/10_grub-common suspend suspend: success.

Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend:
/etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/49tlp suspend suspend:
/usr/lib/pm-utils/sleep.d/49tlp suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/50unload_alx suspend suspend:
/usr/lib/pm-utils/sleep.d/50unload_alx suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:
Failed to connect to non-global ctrl_ifname: (null)  error: No such file or directory
/usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/75modules suspend suspend:
/usr/lib/pm-utils/sleep.d/75modules suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/90clock suspend suspend:
/usr/lib/pm-utils/sleep.d/90clock suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend:
/usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/95anacron suspend suspend:
stop: Unknown instance: 
/usr/lib/pm-utils/sleep.d/95anacron suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend:
/usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/95led suspend suspend:
/usr/lib/pm-utils/sleep.d/95led suspend suspend: not applicable.

Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend:
ATI Catalyst driver detected, not using quirks.
/usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend: success.

Running hook /usr/lib/pm-utils/sleep.d/99video suspend suspend:
kernel.acpi_video_flags = 0
/usr/lib/pm-utils/sleep.d/99video suspend suspend: success.

Running hook /etc/pm/sleep.d/novatel_3g_suspend suspend suspend:
/etc/pm/sleep.d/novatel_3g_suspend suspend suspend: success.

Thu Sep 10 22:50:06 EDT 2015: performing suspend

更新2:看起来这个问题可能超出了 Ubuntu 的范围。我不确定如何开始调试它。有什么想法吗?

https://forums.gentoo.org/viewtopic-p-7772846.html?sid=7ab6dd35c3dfc7a38a2c1b02edb15044

https://bbs.archlinux.org/viewtopic.php?id=199388

答案1

事实证明,这是 MacbookPro 11,4 和 11,5 在最新主线 Linux 内核(我认为在撰写本文时直到 4.6)中存在的问题。有一种解决方法需要修补/编译自定义内核。它位于评论 #172https://bugzilla.kernel.org/show_bug.cgi?id=103211。 具体来说,

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ee72ebe..d3ec833 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2775,6 +2775,13 @@ static void quirk_hotplug_bridge(struct pci_dev *dev)

 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HINT, 0x0020, quirk_hotplug_bridge);

+static void quirk_hotplug_bridge_skip(struct pci_dev *dev)
+{
+       dev->is_hotplug_bridge = 0;
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x8c10, quirk_hotplug_bridge_skip);
+
 /*
  * This is a quirk for the Ricoh MMC controller found as a part of
  * some mulifunction chips.

从评论中可以看出,似乎有少数人已经确认这确实可以在使用不同 4.X 版本的 Linux 内核的 Ubuntu 14.04 和 16.04 中工作。我现在正在 16.04 上测试,如果一切正常,我会接受这个答案。如果其他人愿意在较早的内核版本 (3.X) 上确认 14.04 上的这个补丁,请在下面评论。

更新:我可以确认这在内核为 v4.4.0-28-generic 的 Ubuntu 16.04 中有效。我执行了以下步骤:

一切似乎都正常运转。

答案2

我找到了解决方案https://joshtronic.com/2017/03/13/getting-suspend-in-linux-working-on-a-macbook-pro/-- 对我有用的(在 16.04LTS 上),是将以下内容添加到/etc/rc.local

#!/bin/sh -e
echo LID0 > /proc/acpi/wakeup
echo XHC1 > /proc/acpi/wakeup
exit 0

不过,我建议在添加到文件之前手动测试一下。这可以通过运行sudo -i并随后输入各行来完成。


echo LID0 > /proc/acpi/wakeup只需翻转是否LID0应引起唤醒即可。


一个令人遗憾的副作用是,当盖子打开时,电脑将无法再开机

相关内容