我的 MacBookPro 9,2 和 NixOS 20.09 上的 Wifi 出现问题:Wifi 随机停止工作(随机意味着:在电脑上工作一段时间后,每隔几天就会发生一次,有时一天会发生多次),同时,我的光标开始滞后/跳动,滚动不再流畅。一旦发生这种情况,Wifi 将无法工作,光标也不会流畅,直到我重新启动。不过,LAN 仍然有效。
我使用 X11,X.Org 版本 1.20.10。
我使用 NetworkManager 1.26.0 版来管理无线连接。我确信无线连接失败是因为 wpa_supplicant 无法扫描 Wifi 网络(出现此错误时,NetworkManager 中将不再显示 Wifi 网络)。
这是journalctl
上次发生时(11:24)的日志:
Feb 07 11:22:22 sydney rtkit-daemon[7369]: Supervising 4 threads of 2 processes of 1 users.
Feb 07 11:22:22 sydney rtkit-daemon[7369]: Supervising 4 threads of 2 processes of 1 users.
Feb 07 11:22:24 sydney xsession[24782]: JavaScript error: resource://gre/modules/ExtensionChild.jsm, line 813: DataCloneError: The object could not be cloned.
Feb 07 11:23:39 sydney systemd[7277]: emacs.service: start operation timed out. Terminating.
Feb 07 11:23:39 sydney systemd[7277]: emacs.service: Failed with result 'timeout'.
Feb 07 11:23:39 sydney systemd[7277]: Failed to start Emacs: the extensible, self-documenting text editor.
Feb 07 11:23:40 sydney systemd[7277]: emacs.service: Scheduled restart job, restart counter is at 47.
Feb 07 11:23:40 sydney systemd[7277]: Stopped Emacs: the extensible, self-documenting text editor.
Feb 07 11:23:40 sydney systemd[7277]: Starting Emacs: the extensible, self-documenting text editor...
Feb 07 11:23:40 sydney bash[31181]: Warning: due to a long standing Gtk+ bug
Feb 07 11:23:40 sydney bash[31181]: https://gitlab.gnome.org/GNOME/gtk/issues/221
Feb 07 11:23:40 sydney bash[31181]: Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Feb 07 11:23:40 sydney bash[31181]: Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
Feb 07 11:23:40 sydney bash[31182]: Loading /nix/store/6m1v0rgk7x1fp16254vsf2ll3hk36y25-emacs-27.1/share/emacs/site-lisp/site-start.el (source)...
Feb 07 11:23:40 sydney bash[31182]: Loading /nix/store/6m1v0rgk7x1fp16254vsf2ll3hk36y25-emacs-27.1/share/emacs/site-lisp/site-start.el (source)...done
Feb 07 11:23:41 sydney bash[31182]: [yas] Prepared just-in-time loading of snippets successfully.
Feb 07 11:23:41 sydney bash[31182]: Loading /home/gecku/.emacs.d/custom.el (source)...
Feb 07 11:23:41 sydney bash[31182]: Loading /home/gecku/.emacs.d/custom.el (source)...done
Feb 07 11:23:55 sydney wpa_supplicant[1842]: wlp2s0: CTRL-EVENT-DISCONNECTED bssid=a0:ff:70:a0:6c:70 reason=0
Feb 07 11:23:56 sydney wpa_supplicant[1842]: wlp2s0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 07 11:23:56 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:23:56 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:23:57 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:23:57 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:23:58 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:23:58 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:23:59 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:23:59 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:00 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:00 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:01 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:01 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:02 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:02 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:03 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:03 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:04 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:04 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:05 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:05 sydney wpa_supplicant[1842]: wlp2s0: Failed to initiate AP scan
Feb 07 11:24:11 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:12 sydney dbus-daemon[1358]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatc>
Feb 07 11:24:12 sydney systemd[1]: Starting Network Manager Script Dispatcher Service...
Feb 07 11:24:12 sydney dbus-daemon[1358]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Feb 07 11:24:12 sydney systemd[1]: Started Network Manager Script Dispatcher Service.
Feb 07 11:24:12 sydney NetworkManager[1699]: <warn> [1612693452.2719] device (wlp2s0): Deactivation failed: GDBus.Error:fi.w1.wpa_supplicant1.NotConnected: >
Feb 07 11:24:12 sydney nscd[24552]: 24552 monitored file `/etc/resolv.conf` was written to
Feb 07 11:24:12 sydney systemd[1]: Stopping Name Service Cache Daemon...
Feb 07 11:24:12 sydney systemd[1]: nscd.service: Succeeded.
Feb 07 11:24:12 sydney systemd[1]: Stopped Name Service Cache Daemon.
Feb 07 11:24:12 sydney systemd[1]: nscd.service: Consumed 212ms CPU time, received 37.5K IP traffic, sent 21.7K IP traffic.
Feb 07 11:24:12 sydney systemd[1]: Starting Name Service Cache Daemon...
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring file `/etc/passwd` (1)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring file `/etc/group` (3)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring file `/etc/hosts` (4)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring file `/etc/resolv.conf` (5)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring file `/etc/services` (6)
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31372]: 31372 disabled inotify-based monitoring for file `/etc/netgroup': No such file or directory
Feb 07 11:24:12 sydney nscd[31372]: 31372 stat failed for file `/etc/netgroup'; will try again later: No such file or directory
Feb 07 11:24:12 sydney systemd[1]: Started Name Service Cache Daemon.
Feb 07 11:24:12 sydney nscd[31372]: 31372 monitored file `/etc/resolv.conf` was written to
Feb 07 11:24:12 sydney systemd[1]: Stopping Name Service Cache Daemon...
Feb 07 11:24:12 sydney xsession[7345]: WARNING: No icon found in path: 'nm-no-connection'
Feb 07 11:24:12 sydney kernel: ERROR @wl_cfg80211_scan :
Feb 07 11:24:12 sydney kernel: WLC_SCAN error (-22)
Feb 07 11:24:12 sydney wpa_supplicant[1842]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-22Feb 07 11:24:12 sydney systemd[1]: nscd.service: Succeeded.
Feb 07 11:24:12 sydney systemd[1]: Stopped Name Service Cache Daemon.
Feb 07 11:24:12 sydney systemd[1]: Starting Name Service Cache Daemon...
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring file `/etc/passwd` (1)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring file `/etc/group` (3)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring file `/etc/hosts` (4)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring file `/etc/resolv.conf` (5)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring file `/etc/services` (6)
Feb 07 11:24:12 sydney nscd[31429]: 31429 monitoring directory `/etc` (2)
Feb 07 11:24:12 sydney nscd[31429]: 31429 disabled inotify-based monitoring for file `/etc/netgroup': No such file or directory
Feb 07 11:24:12 sydney nscd[31429]: 31429 stat failed for file `/etc/netgroup'; will try again later: No such file or directory
Feb 07 11:24:12 sydney systemd[1]: Started Name Service Cache Daemon.
Feb 07 11:24:12 sydney kernel: ERROR @wl_cfg80211_scan :
Feb 07 11:24:12 sydney kernel: WLC_SCAN error (-22)
Feb 07 11:24:12 sydney wpa_supplicant[1842]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-22 retry=1
Feb 07 11:24:13 sydney xsession[25848]: JavaScript error: resource:///modules/imCore.jsm, line 152: TypeError: this._idleService is undefined
Feb 07 11:24:13 sydney wpa_supplicant[1842]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-22 retry=1
Feb 07 11:24:13 sydney kernel: ERROR @wl_cfg80211_scan :
Feb 07 11:24:13 sydney kernel: WLC_SCAN error (-22)
Feb 07 11:24:14 sydney wpa_supplicant[1842]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-22 retry=1
Feb 07 11:24:14 sydney kernel: ERROR @wl_cfg80211_scan :
Feb 07 11:24:14 sydney kernel: WLC_SCAN error (-22)
Feb 07 11:24:22 sydney systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Feb 07 11:24:31 sydney nscd[31429]: 31429 checking for monitored file `/etc/netgroup': No such file or directory
Feb 07 11:24:37 sydney NetworkManager[1699]: <warn> [1612693477.5085] device (wlp2s0): Activation: (wifi) association took too long, failing activation
Feb 07 11:24:37 sydney xsession[7345]: WARNING: No icon found in path: 'nm-no-connection'
Feb 07 11:24:37 sydney NetworkManager[1699]: <warn> [1612693477.5384] device (wlp2s0): Activation: failed for connection 'Vodafone-6C64'
Feb 07 11:24:43 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:45 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:51 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:53 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:24:54 sydney wpa_supplicant[1842]: wlp2s0: Reject scan trigger since one is already pending
Feb 07 11:25:10 sydney systemd[7277]: emacs.service: start operation timed out. Terminating.
Feb 07 11:25:10 sydney systemd[7277]: emacs.service: Failed with result 'timeout'.
Feb 07 11:25:10 sydney systemd[7277]: Failed to start Emacs: the extensible, self-documenting text editor.
Feb 07 11:25:10 sydney systemd[7277]: emacs.service: Scheduled restart job, restart counter is at 48.
Feb 07 11:25:10 sydney systemd[7277]: Stopped Emacs: the extensible, self-documenting text editor.
Feb 07 11:25:10 sydney systemd[7277]: Starting Emacs: the extensible, self-documenting text editor...
警告Reject scan trigger since one is already pending
声音非常像 Broadcom 驱动程序挂起时的扫描......
输出lspci -vnn -d 14e4:
:
01:00.0 Ethernet controller [0200]: Broadcom Inc. and subsidiaries NetXtreme BCM57765 Gigabit Ethernet PCIe [14e4:16b4] (rev 10)
Subsystem: Broadcom Inc. and subsidiaries NetXtreme BCM57765 Gigabit Ethernet PCIe [14e4:16b4]
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at a0400000 (64-bit, prefetchable) [size=64K]
Memory at a0410000 (64-bit, prefetchable) [size=64K]
Capabilities: <access denied>
Kernel driver in use: tg3
Kernel modules: tg3
01:00.1 SD Host controller [0805]: Broadcom Inc. and subsidiaries BCM57765/57785 SDXC/MMC Card Reader [14e4:16bc] (rev 10) (prog-if 01)
Subsystem: Broadcom Inc. and subsidiaries Device [14e4:0000]
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at a0420000 (64-bit, prefetchable) [size=64K]
Capabilities: <access denied>
Kernel driver in use: sdhci-pci
Kernel modules: sdhci_pci
02:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4331 802.11a/b/g/n [14e4:4331] (rev 02)
Subsystem: Apple Inc. AirPort Extreme [106b:00f5]
Flags: bus master, fast devsel, latency 0, IRQ 17
Memory at a0600000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: wl
Kernel modules: bcma, wl
我正在使用broadcom_sta
NixOS 20.09 的驱动程序。
答案1
让这个问题不那么烦人的解决方案是
# rmmod wl
# modprobe wl
这也解决了鼠标光标滞后的问题,我可以重新连接到 Wifi。但这并不能真正解决问题的根源。