AsahiLinux / linux

Linux kernel source tree
Other
2.26k stars 90 forks source link

Lid close and WiFi broken after first suspend/lid close with DisplayLink/evdi driver #246

Closed diamondburned closed 9 months ago

diamondburned commented 9 months ago

Description

On my Asahi Linux (NixOS), ever since yesterday (running asahi-6.5-27), my laptop can no longer reliably suspend on lid close. Moreover, once this happens, WiFi would not work until I restart NetworkManager.

When I close the laptop lid after the first boot, my system would enter the suspend state as usual. However, once I open up the lid and log back in, WiFi would suddenly stop working. NetworkManager would see the device as unmanaged, however, and if I run systemctl restart NetworkManager, then WiFi would work again.

It doesn't end there, though. After waking up from the first suspend, clicking Restart in GNOME or running reboot would not restart the system. Closing the lid would not turn off the display. In fact, the power state seems to be stuck here unless I hold the power button to force shut off.

Upgrading the kernel to 6.5-29 did not fix this issue.

Note that when systemctl suspend is run a second time:

Second suspend attempt returned error `Call to Suspend failed: There's already a shutdown or sleep operation in progress`.

Minor tidbits

This happened roughly yesterday when I was messing around with my Raspberry Pi Zero. Specifically, I was trying to get Ethernet-over-USB working. I made no system modifications while doing this, but I poked around NetworkManager a lot. I fail to see how this would cause the lid issue, but I figured I'm bringing this up here.

The lid closing seems to reliably work for the first time after every fresh boot. After that, it would just stop working. Prior to yesterday, this was working perfectly fine.

Information

Journal logs including first suspend, first wake up, and second suspend attempt. Log shows `kernel|systemd|ModemManager|wpa_supplicant`. Lid was not shut. Power button was pressed at 17:08:40 to wake the system up. ``` Dec 06 17:08:17 lilyhoshii systemd[1675]: Reached target Shutdown. Dec 06 17:08:17 lilyhoshii systemd[1675]: Finished Exit the Session. Dec 06 17:08:17 lilyhoshii systemd[1675]: Reached target Exit the Session. Dec 06 17:08:17 lilyhoshii systemd[1]: user@132.service: Deactivated successfully. Dec 06 17:08:17 lilyhoshii systemd[1]: Stopped User Manager for UID 132. Dec 06 17:08:17 lilyhoshii systemd[1]: Stopping User Runtime Directory /run/user/132... Dec 06 17:08:17 lilyhoshii systemd[1]: run-user-132.mount: Deactivated successfully. Dec 06 17:08:17 lilyhoshii systemd[1]: user-runtime-dir@132.service: Deactivated successfully. Dec 06 17:08:17 lilyhoshii systemd[1]: Stopped User Runtime Directory /run/user/132. Dec 06 17:08:30 lilyhoshii systemd[2337]: Started Application launched by gnome-shell. Dec 06 17:08:31 lilyhoshii systemd[1]: geoclue.service: Deactivated successfully. Dec 06 17:08:34 lilyhoshii systemd-logind[1386]: The system will suspend now! Dec 06 17:08:34 lilyhoshii ModemManager[2175]: [sleep-monitor-systemd] system is about to suspend Dec 06 17:08:34 lilyhoshii systemd[1]: Starting Network Manager Script Dispatcher Service... Dec 06 17:08:34 lilyhoshii systemd[1]: Started Network Manager Script Dispatcher Service. Dec 06 17:08:34 lilyhoshii wpa_supplicant[1623]: wlp1s0f0: CTRL-EVENT-DISCONNECTED bssid=90:4c:81:61:37:b0 reason=3 locally_generated=1 Dec 06 17:08:34 lilyhoshii wpa_supplicant[1623]: wlp1s0f0: CTRL-EVENT-DSCP-POLICY clear_all Dec 06 17:08:34 lilyhoshii wpa_supplicant[1623]: wlp1s0f0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7498: set_run_mode_safe: deferring: 4 -> 1 Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7403: virtual IOMFBStatus IOMFB::UPPipeDCP_H13P::ready_for_run_mode_change(IOMFB::AppleRegisterStream *): initiating deferred run mod Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPTSQManager.cpp:150: IOMFBStatus IOMFB::UPTSQManager::power_down_M3(IOMFB::AppleRegisterStream *, UPTSQManager::ModeChangeWaiter *): request mode ch Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPTSQManager.cpp:162: IOMFBStatus IOMFB::UPTSQManager::power_down_M3(IOMFB::AppleRegisterStream *, UPTSQManager::ModeChangeWaiter *): disabling M3 Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7476: set_run_mode_safe: no need to defer: 1 -> 0 Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:402: IOMFB: VideoInterfaceIOAV::did_power_off: m_power_ctrl->setPower( 0 ) Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:142: IOMFB: IOAVVideoInterface terminated Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:916: void VideoInterfaceIOAV::unplug_gated(IOAVVideoInterface *): display HPD removed ioav=0xffffffff40e4c7b8 Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: DCPDPDevice.cpp:3360: [AFK]registering callback 0xffffffff40e40ba8 saved as 0xffffffff40e9af80 Dec 06 17:08:35 lilyhoshii kernel: apple-dcp 231c00000.dcp: dcp_poweroff() done Dec 06 17:08:36 lilyhoshii wpa_supplicant[1623]: wlp1s0f0: CTRL-EVENT-SCAN-FAILED ret=-100 Dec 06 17:08:36 lilyhoshii systemd[1]: Starting Pre-Sleep Actions... Dec 06 17:08:36 lilyhoshii wpa_supplicant[1623]: wlp1s0f0: CTRL-EVENT-DSCP-POLICY clear_all Dec 06 17:08:36 lilyhoshii wpa_supplicant[1623]: wlp1s0f0: CTRL-EVENT-DSCP-POLICY clear_all Dec 06 17:08:36 lilyhoshii wpa_supplicant[1623]: nl80211: deinit ifname=wlp1s0f0 disabled_11b_rates=0 Dec 06 17:08:37 lilyhoshii systemd[1]: systemd-localed.service: Deactivated successfully. Dec 06 17:08:37 lilyhoshii systemd[1]: systemd-hostnamed.service: Deactivated successfully. Dec 06 17:08:40 lilyhoshii systemd-logind[1386]: Power key pressed short. Dec 06 17:08:40 lilyhoshii kernel: macsmc-rtkit 23e400000.smc: RTKit: syslog message: apComms.cpp:375: SMC HID Event: 01 06 01 Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: dcp_poweron() starting Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7476: set_run_mode_safe: no need to defer: 0 -> 1 Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: ock_Tunables_v1.cpp:377: IOMFB: Writing tunables with target 4 Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7476: set_run_mode_safe: no need to defer: 1 -> 2 Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:225: bool VideoInterfaceIOAV::open_ioav_gated(): IOAVVideoInterface open failed Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:284: IOMFB: VideoInterfaceIOAV::power_on: m_power_ctrl->setPower( 1 ) Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: AppleDCPDPTX.cpp:381: [AFK]powering nub 0x8547d8 Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: AppleDCPDPTX.cpp:381: [AFK]powering nub 0x854910 Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: set_digital_out_mode(color:1 timing:2) Dec 06 17:08:40 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: nifiedPipeline.cpp:6548: set_digital_out_mode returned 8000000b Dec 06 17:08:41 lilyhoshii kernel: macsmc-rtkit 23e400000.smc: RTKit: syslog message: apComms.cpp:375: SMC HID Event: 01 06 00 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: ileCDIDPDisplay.cpp:119: [AFK]SAC enable: DP=1 CDI=1 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: DCPDP13Service.cpp:55: [AFK]version: 13 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: DCPDPService.cpp:69: [AFK]version: 13 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: DCPDPDevice.cpp:3360: [AFK]registering callback 0xffffffff40f73838 saved as 0xffffffff40e478d0 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: ctVideoInterface.cpp:50: [AFK]creating SimpleVideoInterface (0xffffffff40df12d0) Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: tVideoInterface.cpp:143: [AFK]DCPAVSimpleVideoInterface (0xffffffff40df12d0) Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:131: IOMFB: IOAVVideoInterface published Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: eoInterfaceIOAV.cpp:558: IOMFBStatus VideoInterfaceIOAV::plug_gated(IOAVVideoInterface *): display HPD asserted ioav=0xffffffff40df12d0 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7498: set_run_mode_safe: deferring: 2 -> 4 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipeDCP_H13P.cpp:7403: virtual IOMFBStatus IOMFB::UPPipeDCP_H13P::ready_for_run_mode_change(IOMFB::AppleRegisterStream *): initiating deferred run mod Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: M3Hal_v1.cpp:196: IOMFB: load APT M3 IMem : size 0x7178 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: M3Hal_v1.cpp:196: IOMFB: load APT M3 DMem : size 0x6e04 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: CAHandler.cpp:163: IOMFB load_ca_data: Unrecognized data version 0 (expected 1 or 2) Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPPipe.cpp:3456: IOMFB read_pmu_data_sync: pmu ram read error (e00800d8) Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: PPipeDCP_H13P.cpp:10100: IOMFB Int RTBandwidth: program_M3_rt_config: Using Legacy, scratch 23b738014 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: PPipeDCP_H13P.cpp:10120: IOMFB Int RTBandwidth: using legacy. Doorbell 23bc3c000, bit 2 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPTSQManager.cpp:133: IOMFB: clearing M3 reset Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPTSQ_Hal_v1.cpp:250: IOMFB: timebase_offset = 4 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: UPTSQManager.cpp:105: IOMFB: switch to normal mode succeeded Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: ock_PCC2DLTM_v1.cpp:796: IOMFBStatus IOMFB::UPBlock_PCC2DLTM_v1::set_mcpu_power(IOMFB::AppleRegisterStream *, bool) Loading M3 Hal Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: M3Hal_v1.cpp:196: IOMFB: load LTM M3 IMem : size 0x58e8 Dec 06 17:08:41 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: M3Hal_v1.cpp:196: IOMFB: load LTM M3 DMem : size 0xbd24 Dec 06 17:08:42 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: BrightnessLCD.cpp:743: [AFK]nitsToDBV: iDAC out of range Dec 06 17:08:42 lilyhoshii kernel: apple-dcp 231c00000.dcp: RTKit: syslog message: BrightnessLCD.cpp:743: [AFK]nitsToDBV: iDAC out of range Dec 06 17:08:46 lilyhoshii systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully. ```
diamondburned commented 9 months ago

Closing this since it's caused by NixOS and Arch's displaylink sleep code:

I'll figure out a way to disable suspending as long as DisplayLink is connected so that I don't need this. That's unrelated to this issue, though.