rmi_smbus 导致关闭盖子时冻结

rmi_smbus 导致关闭盖子时冻结

这适用于在 Lenovo ThinkPad Edge E531 上全新安装的 Ubuntu 20.04、内核 5.4.0-40-generic。

症状:合上盖子会关闭显示屏,但笔记本电脑不会进入睡眠状态。系统冻结。重新打开盖子后,系统完全没有响应(无法通过 Ctrl-Alt-F1 登录,有趣的是断开和连接电源会使系统播放相应的声音,似乎无法进行其他交互)。

我发现sudo modprobe -r rmi_smbus在合上盖子之前运行可以完全解决问题。笔记本电脑正常进入睡眠状态并正常唤醒。当然,触控板没有反应。我必须sudo modprobe rmi_smbus在打开盖子并登录后手动调用。然后触控板再次正常工作。

这是关闭盖子时加载journalctl的结果。rmi_smbus

Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 systemd-logind[853]: Lid closed.
Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 systemd-logind[853]: Suspending...
Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 NetworkManager[817]: <info>  [1594304718.5145] manager: sleep: sleep requested (sleeping: no  enabled: yes)
Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 NetworkManager[817]: <info>  [1594304718.5146] device (enp5s0): state change: unavailable -> unmanaged (reason 'sleeping', sys-iface-state:>
Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 gnome-shell[1228]: Screen lock is locked down, not locking
Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 NetworkManager[817]: <info>  [1594304718.5460] manager: NetworkManager state is now ASLEEP
Jul 09 16:25:18 myuser-ThinkPad-Edge-E531 whoopsie[1400]: [16:25:18] offline
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 gnome-shell[1779]: Error adding children to desktop: desktopGrid is undefined
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 gnome-shell[1779]: Error adding children to desktop: desktopGrid is undefined
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 systemd[1]: Reached target Sleep.
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 systemd[1]: Starting Suspend...
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 systemd-sleep[2902]: Suspending system...
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 kernel: PM: suspend entry (deep)
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 kernel: Filesystems sync: 0.005 seconds
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "44"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event2  - Power Button: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "47"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event8  - Video Bus: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "48"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event9  - Video Bus: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "49"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event0  - Power Button: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "50"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event4  - PIXART USB OPTICAL MOUSE: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "51"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event6  - Integrated Camera: Integrated C: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "52"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event3  - AT Translated Set 2 keyboard: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "53"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event5  - ThinkPad Extra Buttons: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "54"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event7  - Synaptics TM2722-001: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (**) Option "fd" "55"
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) event14 - TPPS/2 IBM TrackPoint: device removed
Jul 09 16:25:19 myuser-ThinkPad-Edge-E531 kernel: rfkill: input handler enabled
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:67
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:69
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 226:0
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:68
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:73
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:64
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:66
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:70
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:78
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: Freezing user space processes ... (elapsed 0.002 seconds) done.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: OOM killer disabled.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-6).
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: psmouse serio2: Failed to disable mouse on rmi4-00.fn03/serio0
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-6).
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-6).
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: wlp4s0: deauthenticating from 34:31:c4:2c:98:a3 by local choice (Reason: 3=DEAUTH_LEAVING)
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_f01 rmi4-00.fn01: Failed to write sleep mode: -6.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_f01 rmi4-00.fn01: Suspend failed with code -6.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_physical rmi4-00: Failed to suspend functions: -6
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_smbus 0-002c: Failed to suspend device: -6
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: PM: dpm_run_callback(): rmi_smb_suspend+0x0/0x40 [rmi_smbus] returns -6
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: PM: Device 0-002c failed to suspend: error -6
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: PM: Some devices failed to suspend, or early wake event detected
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: iwlwifi 0000:04:00.0: Radio type=0x2-0x0-0x0
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: iwlwifi 0000:04:00.0: Radio type=0x2-0x0-0x0
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: OOM killer enabled.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: Restarting tasks ... 
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-6).
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: done.
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_physical rmi4-00: rmi_driver_clear_irq_bits: Failed to change enabled interrupts!
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:72
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: got pause for 13:71
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 wpa_supplicant[860]: wlp4s0: CTRL-EVENT-DISCONNECTED bssid=34:31:c4:2c:98:a3 reason=3 locally_generated=1
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 NetworkManager[817]: <warn>  [1594304720.4336] sup-iface[0x55eb6a22c110,wlp4s0]: connection disconnected (reason -3)
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 wpa_supplicant[860]: wlp4s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 NetworkManager[817]: <info>  [1594304720.4413] device (wlp4s0): supplicant interface state: completed -> disconnected
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 acpid[805]: client 1518[0:0] has disconnected
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 gnome-shell[1228]: An active wireless connection, in infrastructure mode, involves no access point?
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1024]: (II) config/udev: removing device TPPS/2 IBM TrackPoint
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1024]: (II) UnloadModule: "libinput"
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1024]: (II) systemd-logind: releasing fd for 13:78
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) config/udev: removing device TPPS/2 IBM TrackPoint
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: rmi4_physical rmi4-00: rmi_driver_set_irq_bits: Failed to change enabled interrupts!
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: psmouse: probe of serio2 failed with error -1
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) UnloadModule: "libinput"
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (II) systemd-logind: releasing fd for 13:78
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 /usr/lib/gdm3/gdm-x-session[1518]: (EE) systemd-logind: failed to release device: Device not taken
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 NetworkManager[817]: <info>  [1594304720.5362] device (wlp4s0): supplicant interface state: disconnected -> scanning
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 gnome-shell[1779]: An active wireless connection, in infrastructure mode, involves no access point?
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: PM: suspend exit
Jul 09 16:25:20 myuser-ThinkPad-Edge-E531 kernel: PM: suspend entry (s2idle)
-- Reboot -- // << this was me long-pressing the power button to reboot

有什么建议可以尝试吗?我可以手动卸载rmi_smbus module睡眠前的内容,然后再重新加载吗?或者有更优雅的解决方案吗?

答案1

以下是我的快速而粗略的解决方案,尽管我不确定它在系统更新或升级方面效果如何。这个想法是在挂起之前和之后手动卸载并重新加载有问题的内核模块。

  1. 在终端中以 root 身份登录:sudo -s
  2. 运行nano /usr/lib/systemd/system-sleep/pre-suspend-unload-rmi-smbus.sh并输入以下文件内容:
#!/bin/bash
if [ "${1}" == "pre" ]; then
modprobe -r rmi_smbus
elif [ "${1}" == "post" ]; then
modprobe rmi_smbus
fi
  1. 使文件可执行:chmod +x /usr/lib/systemd/system-sleep/pre-suspend-unload-rmi-smbus.sh
  2. 重新启动(但不确定是否需要此步骤)

答案2

我在另一篇文章中看到,rmi_smbus 崩溃与模块的加载顺序有关。对我有用的方法是将 RMI4 构建到内核中,而不是使用模块。

CONFIG_RMI4_CORE=y

睡眠时不再崩溃。这是 Thinkpad T440s。

相关内容