升级 4.14 内核后,图形界面待机失败,但切到文本界正常
Tofloor
poster avatar
duanyao
deepin
2018-01-10 20:13
Author
机型:联想 V470

按这个帖子 ( https://bbs.deepin.org/post/15114 )升级到 4.14 内核,并执行了
gsettings set com.deepin.dde.startdde swap-sched-enabled false

目前在图形界面关机和重启都正常了,但待机还是不正常:按下待机按钮或者在深度终端执行 systemctl suspend 后,黑屏几秒后屏幕重新点亮,出现系统登录界面。
如果用 ctrl+alt+f2 切到文本界面,执行 systemctl suspend,则可以正常待机。
切换回 4.9 内核也是正常的,图形界面可正常待机。

我记录了一下待机前后的日志,发现图形界面与文本界面的日志没有显著区别,区别只是图形界面进入待机后,不需要用户按任何键,系统就自动被唤醒了。
suspend-log.zip

文本界面 systemctl suspend 待机日志摘要:

1月 10 11:05:30 duanyao-laptop systemd[1]: Reached target Sleep.
1月 10 11:05:30 duanyao-laptop systemd[1]: Starting Suspend...
1月 10 11:05:30 duanyao-laptop systemd[1]: Stopping Atop advanced performance monitor...
1月 10 11:05:30 duanyao-laptop systemd[1]: Stopped Atop advanced performance monitor.
1月 10 11:05:30 duanyao-laptop systemd-sleep[18177]: Suspending system...
1月 10 11:05:30 duanyao-laptop kernel: PM: suspend entry (deep)
1月 10 11:05:31 duanyao-laptop kernel: PM: Syncing filesystems ... done.
1月 10 11:05:31 duanyao-laptop kernel: request_firmware: iwlwifi-1000-5.ucode
1月 10 11:05:31 duanyao-laptop kernel: request_firmware: rtl_nic/rtl8168e-2.fw
1月 10 11:05:31 duanyao-laptop kernel: (NULL device *): firmware: direct-loading firmware iwlwifi-1000-5.ucode                【待机成功了】
1月 10 11:09:04 duanyao-laptop kernel: Freezing user space processes ... (elapsed 0.002 seconds) done.                                    【按任意键唤醒】
1月 10 11:09:04 duanyao-laptop kernel: OOM killer disabled.
1月 10 11:09:04 duanyao-laptop kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
1月 10 11:09:04 duanyao-laptop kernel: Suspending console(s) (use no_console_suspend to debug)

图形界面(深度终端执行 systemctl suspend)待机日志摘要:

1月 10 10:46:44 duanyao-laptop systemd[1]: Reached target Sleep.
1月 10 10:46:44 duanyao-laptop systemd[1]: Starting Suspend...
1月 10 10:46:44 duanyao-laptop systemd[1]: Stopping Atop advanced performance monitor...
1月 10 10:46:44 duanyao-laptop systemd[1]: Stopped Atop advanced performance monitor.
1月 10 10:46:44 duanyao-laptop systemd-sleep[11997]: Suspending system...
1月 10 10:46:44 duanyao-laptop kernel: PM: suspend entry (deep)
1月 10 10:47:48 duanyao-laptop kernel: PM: Syncing filesystems ... done.
1月 10 10:47:48 duanyao-laptop kernel: request_firmware: iwlwifi-1000-5.ucode
1月 10 10:47:48 duanyao-laptop kernel: request_firmware: rtl_nic/rtl8168e-2.fw
1月 10 10:47:48 duanyao-laptop kernel: (NULL device *): firmware: direct-loading firmware iwlwifi-1000-5.ucode                   【待机似乎成功了?】
1月 10 10:47:48 duanyao-laptop kernel: Freezing user space processes ... (elapsed 0.004 seconds) done.                                       【不用按键自动唤醒了?】
1月 10 10:47:48 duanyao-laptop kernel: OOM killer disabled.
1月 10 10:47:48 duanyao-laptop kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
1月 10 10:47:48 duanyao-laptop kernel: Suspending console(s) (use no_console_suspend to debug)



Reply Favorite View the author
All Replies
avatar
aida
deepin
2018-01-10 23:09
#1
Reply View the author
avatar
yangbo
deepin
2018-01-11 03:21
#2
从日志看都是待机成功的
肯能时鼠标唤醒的

cat /proc/acpi/wakeup看看
Reply View the author
avatar
duanyao
deepin
2018-01-11 03:27
#3
https://bbs.deepin.org/post/151524
从日志看都是待机成功的
肯能时鼠标唤醒的

$ cat /proc/acpi/wakeup
Device        S-state          Status   Sysfs node
P0P1          S4        *disabled
GLAN          S4        *disabled
EHC1          S3        *enabled   pci:0000:00:1d.0
EHC2          S3        *enabled   pci:0000:00:1a.0
HDEF          S4        *disabled  pci:0000:00:1b.0
RP01          S4        *disabled  pci:0000:00:1c.0
PXSX          S4        *disabled
RP02          S4        *disabled  pci:0000:00:1c.1
PXSX          S4        *disabled  pci:0000:03:00.0
RP03          S4        *disabled
PXSX          S4        *disabled
RP04          S4        *disabled  pci:0000:00:1c.3
PXSX          S4        *disabled  pci:0000:04:00.0
RP05          S4        *disabled
PXSX          S4        *disabled
RP06          S4        *disabled
PXSX          S4        *disabled
RP07          S4        *disabled
PXSX          S4        *disabled
RP08          S4        *disabled
PXSX          S4        *disabled
PEG0          S4        *disabled  pci:0000:00:01.0
PEGP          S4        *disabled  pci:0000:01:00.0
PEG1          S4        *disabled
PEG2          S4        *disabled
PEG3          S4        *disabled
LID0          S3        *enabled   platformNP0C0D:00
SLPB          S3        *enabled   platformNP0C0E:00
Reply View the author
avatar
yangbo
deepin
2018-01-11 03:38
#4
试试 find /sys/ -iname "wakeup" -type f -exec /bin/bash -c "echo disabled > '{}'" \;

不过这样待机后只能按店员键唤醒
Reply View the author
avatar
duanyao
deepin
2018-01-11 03:48
#5
https://bbs.deepin.org/post/151524
从日志看都是待机成功的
肯能时鼠标唤醒的

还真是,拔掉鼠标后(只用触摸板操作),图形界面待机就能成功了。
Reply View the author
avatar
duanyao
deepin
2018-01-11 04:00
#6
https://bbs.deepin.org/post/151524
试试 find /sys/ -iname "wakeup" -type f -exec /bin/bash -c "echo disabled > '{}'" \;

不过这样待机后 ...

这样确实有效,连着鼠标也可以,不过并没有出现只能按电源键唤醒的情况。
Reply View the author
avatar
152******14
deepin
2018-01-11 06:37
#7
我这从输入密码到进入桌面过程中也会黑屏,其实我密码还没输入完   就黑屏了。
Reply View the author
avatar
yangbo
deepin
2018-01-11 18:08
#8
feedback..
Reply View the author
avatar
duanyao
deepin
2018-01-24 20:23
#9
更新到 4.14.12 后,似乎问题更诡异了,用5楼的方法、拔掉鼠标也不一定管用了,问题的出现似乎有些随机性。不过刚重启系统后一般可以待机,使用一段时间后待机就越来越难成功了。
注销用户到登录界面似乎一般可以待机成功。

https://bbs.deepin.org/user/32991 是否有新消息?
Reply View the author
avatar
duanyao
deepin
2018-04-26 03:13
#10
@yangbo

接着10楼,我今天偶然发现当前最新内核( 4.14.0-deepin2-amd64 #1 SMP PREEMPT Deepin 4.14.12-2 (2018-01-06) x86_64 GNU/Linux )的待机失败问题其实与蓝牙有关。具体规律是:

1. 蓝牙打开的状态下,刚启动系统后的头两次待机一般是会成功的;从待机状态恢复后蓝牙也是正常的。
2. 蓝牙打开的状态下,一般从第三次待机开始就不成功了,现象是按下待机->黑屏2-3分钟,期间电源灯从常亮转为闪烁,迅即又转为常亮->重新亮屏。
  亮屏后检查蓝牙,发现蓝牙设备消失了( 根据 lsusb );搬动硬件wifi/蓝牙开关两次,蓝牙设备又重新出现并工作正常。
3. 蓝牙关闭的状态下(可以是硬件开关关闭、软关闭(用blueman),或因为上述待机失败而关闭),待机总是成功的。

我的蓝牙设备型号和usb地址:

$ sudo dmesg | grep -i blue
[    2.443599] usb 2-1.4: Product: Broadcom Bluetooth 2.1 Device

$ lsusb
Bus 002 Device 004: ID 0489:e00d Foxconn / Hon Hai Broadcom Bluetooth 2.1 Device

下面是第2种情况下待机失败的相关日志(注意到 usb 2-1.4 就是我的蓝牙设备):

$ sudo journalctl -f | grep -i usb
4月 25 17:53:36 duanyao-laptop kernel: usb 1-1.5: reset high-speed USB device number 4 using ehci-pci
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.6: reset high-speed USB device number 5 using ehci-pci
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.3: reset full-speed USB device number 3 using ehci-pci
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.3: device descriptor read/64, error -32
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.3: device descriptor read/64, error -32
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.3: reset full-speed USB device number 3 using ehci-pci
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.3: device descriptor read/64, error -32
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.3: device descriptor read/64, error -32
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.4: reset full-speed USB device number 13 using ehci-pci
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.4: device descriptor read/64, error -110
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.4: device descriptor read/64, error -110
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.4: reset full-speed USB device number 13 using ehci-pci
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.4: device descriptor read/64, error -110
4月 25 17:53:36 duanyao-laptop kernel: usb 2-1.4: device descriptor read/64, error -110

失败时的蓝牙设备(可见 rfkill 少了 9: hci0: Bluetooth,而 lsusb 则没有蓝牙设备):
$ rfkill list
0: ideapad_wlan: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: ideapad_bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
2: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no

$ lsusb
(没有bluetooth)

而第1种情况下待机成功的相关日志:

$ sudo journalctl -f | grep -i usb
4月 25 17:39:13 duanyao-laptop kernel: usb 1-1.5: reset high-speed USB device number 4 using ehci-pci
4月 25 17:39:13 duanyao-laptop kernel: usb 2-1.3: reset full-speed USB device number 3 using ehci-pci
4月 25 17:39:13 duanyao-laptop kernel: usb 2-1.4: reset full-speed USB device number 6 using ehci-pci
4月 25 17:39:13 duanyao-laptop kernel: usb 2-1.6: reset high-speed USB device number 5 using ehci-pci
4月 25 17:39:13 duanyao-laptop kernel: usb 2-1.4:1.0: rebind failed: -517
4月 25 17:39:13 duanyao-laptop kernel: usb 2-1.4:1.1: rebind failed: -517
4月 25 17:39:13 duanyao-laptop kernel: usb 2-1.4: reset full-speed USB device number 6 using ehci-pci

成功时的蓝牙设备:

$ lsusb
Bus 002 Device 046: ID 0489:e00d Foxconn / Hon Hai Broadcom Bluetooth 2.1 Device

$ rfkill list
0: ideapad_wlan: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: ideapad_bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
2: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
9: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
Reply View the author
avatar
duanyao
deepin
2018-04-26 03:19
#11
本帖最后由 duanyao 于 2018-4-25 19:33 编辑

此外我还测试了其它内核:
4.9.0-deepin13-amd64:待机从来没问题,也不影响蓝牙。
用 UKUU 安装的 4.15.18-041518-generic:与  4.14.0-deepin2-amd64 问题相同。

所以看来是新内核导致的兼容性问题。但既然关闭蓝牙的情况下新内核待机也没问题,那么待机的程序是否可以改一下:待机前关闭蓝牙,恢复后再打开蓝牙?

Reply View the author
avatar
duanyao
deepin
2018-04-26 03:34
#12
呼叫一下
@jingle @aida
Reply View the author