31
submitted 1 year ago* (last edited 1 year ago) by RossoErcole@kbin.social to c/linux@lemmy.ml

Hi, this is a long lasting problem that I didn't really manage to fix when I started using linux (Mint, Cinnamon). But now that I've been using it regularly for half a year and I have more experience in fiddling around, I'm trying to get it resolved.

Whenever I suspend the laptop (or close the lid, which does it automatically) the Wifi and sometimes an external monitor don't work anymore, I don't know what the problem is. The wifi is fixed by powering on and off again. To fix the monitor sometimes even powering off and on again didn't fix it, I usually waited for the next day and it worked again.

I've no idea of how to fix this (Linux Mint forums didn't help at the time)

Laptop is an MSI GS65-Stealth-Thin-8RF running Linux Mint, with Cinnamon Desktop

journalctl output: https://sharetext.me/q7eo87psmq

System Details


System:
Kernel: 5.15.0-91-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 5.8.4
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Machine:
Type: Laptop System: Micro-Star product: GS65 Stealth Thin 8RF v: REV:1.0
serial: <superuser required> Chassis: type: 10 serial: <superuser required>
Mobo: Micro-Star model: MS-16Q2 v: REV:1.0 serial: <superuser required>
UEFI: American Megatrends v: E16Q2IMS.112 date: 05/21/2019
CPU:
Info: 6-core model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Coffee Lake rev: A cache:
L1: 384 KiB L2: 1.5 MiB L3: 9 MiB
Speed (MHz): avg: 941 high: 1025 min/max: 800/4100 cores: 1: 913 2: 875 3: 1025 4: 867 5: 952
6: 911 7: 979 8: 921 9: 966 10: 994 11: 904 12: 988 bogomips: 52799
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Micro-Star MSI driver: i915
v: kernel ports: active: eDP-1 empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:3e9b
Device-2: NVIDIA GP104M [GeForce GTX 1070 Mobile] vendor: Micro-Star MSI driver: nvidia
v: 535.129.03 pcie: speed: 2.5 GT/s lanes: 16 ports: active: none empty: DP-2,HDMI-A-2
bus-ID: 01:00.0 chip-ID: 10de:1ba1
Network:
Device-1: Qualcomm Atheros Killer E2500 Gigabit Ethernet vendor: Micro-Star MSI driver: alx
v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 3d:00.0 chip-ID: 1969:e0b1
IF: enp61s0 state: down mac: <filter>
Device-2: Intel Wireless-AC 9260 driver: iwlwifi v: kernel pcie: speed: 5 GT/s lanes: 1
bus-ID: 3e:00.0 chip-ID: 8086:2526
IF: wlp62s0 state: up mac: <filter>
Bluetooth:
Device-1: Intel Wireless-AC 9260 Bluetooth Adapter type: USB driver: btusb v: 0.8 bus-ID: 1-14:3
chip-ID: 8087:0025
Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 3.0 lmp-v: 5.1
sub-v: 100

all 35 comments
sorted by: hot top controversial new old
[-] just_another_person@lemmy.world 6 points 1 year ago* (last edited 1 year ago)

I'm not sure what the question here is. Are you wondering which level of suspension you want your laptop to go into when you close the lid?

You should understand ACPI sleep states when trying to setup whatever active states you want your machine to be in when you close the lid, because there is a chain of events that happen when you do so. Your machine may only support one, or a few states (s0-s3) that may not allow this. The first step is above, and the second is understanding what state your machine is being put into once you close that lid, so start there with Mint configuration and how it's dealing with the lid closing.

[-] visor841@lemmy.world 2 points 1 year ago

I believe they're saying that when come back from suspension, the wifi doesn't work until they reboot.

[-] RossoErcole@kbin.social 0 points 1 year ago

I'm not sure, but there is a Power Managment menu in Cinnamon and I have creenshots:

[-] Frederic@beehaw.org 4 points 1 year ago* (last edited 1 year ago)

You need to unload your wifi module before suspend.

Without systemd it's easy:

create a file /etc/pm/config.d/config containing:

HOOK_BLACKLIST="wireless"
SUSPEND_MODULES=”NAME_OF_YOUR_WIFI_MODULE”
SUSPEND_MODULES=”wl”

With systemd try this

create a file /usr/lib/systemd/system-sleep/fix-wifi.sh containing (fuck this editor, replace the "##" with "&&") :

#!/bin/bash
[ "$1" = "post" ] ## exec /usr/sbin/modprobe NAME_OF_YOUR_WIFI_MODULE
[ "$1" = "pre" ] ## exec /usr/sbin/modprobe -r NAME_OF_YOUR_WIFI_MODULE
exit 0

and make it executable with chmod 755 /usr/lib/systemd/system-sleep/fix-wifi.sh

[-] RossoErcole@kbin.social 1 points 1 year ago* (last edited 1 year ago)

It doesn't work, should it look like this the script?

#!/bin/sh
[ "$1" = "post" ] ## exec /usr/sbin/modprobe Intel Corporation Wireless-AC 9260
[ "$1" = "pre" ] ## exec /usr/sbin/modprobe -r Intel Corporation Wireless-AC 9260
exit 0

EDIT: should the name be something like wlp62s0 ??? I'm going to try it

[-] Frederic@beehaw.org 1 points 1 year ago* (last edited 1 year ago)

you have to replace the ## with &&

the name should be iwlwifi

[-] RossoErcole@kbin.social 1 points 1 year ago* (last edited 1 year ago)

how do I check the name? because iwlwifi doesn't work

[-] Frederic@beehaw.org 1 points 1 year ago* (last edited 1 year ago)

well, are you sure the script is executed? I don't know systemd enough :-(

First, do a test in command line modprobe -r iwlwifi

then suspend your laptop, resume it after a few seconds then do

modprobe iwlwifi

and see if wifi is working

[-] RossoErcole@kbin.social 1 points 1 year ago* (last edited 1 year ago)

Yeah, thanks for the help even if you don't know much. I get stuck on the first command where I get this error:

rmmod: ERROR: ../libkmod/libkmod-module.c:799 kmod_module_remove_module() could not remove 'iwlmvm': Operation not permitted
rmmod: ERROR: could not remove module iwlmvm: Operation not permitted
rmmod: ERROR: Module iwlwifi is in use by: iwlmvm
modprobe: FATAL: Error running remove command for iwlwifi

[-] Frederic@beehaw.org 1 points 1 year ago

yes of course

sudo modprobe -r iwlwifi

[-] RossoErcole@kbin.social 1 points 1 year ago

I've tried. After suspension but before modprobe the wifi is not available, after modprobe it is there, but is disabled and cannot be enabled.

[-] Frederic@beehaw.org 0 points 1 year ago

So I don't know :-(

Have you disabled Fast Boot in your BIOS ?

[-] RossoErcole@kbin.social 2 points 1 year ago* (last edited 1 year ago)

It was but it got reenabled, I disabled it again but it still doesn't work damn. I'll post the Intel I gathered on the Linux mint forum (I did in the past but now I have more information)

[-] xkoe@lemmy.dbzer0.com 3 points 1 year ago* (last edited 1 year ago)

Is your laptop, by any chance, an HP? I had the same issue with wifi and finally, after about a year of frustration, found the solution HERE. To save a click, here's the part that worked for me, with the disclaimer that I don't honestly know how this works, but by the time I found it I was frustrated enough to run random code from the internet with sudo privileges on my main machine:

First, create the file

/etc/systemd/system/hp-keycodes.service

and type/copy-paste the following into it:

[Unit]
Description=HP setkeycodes fix

[Service]
Type=oneshot
Restart=no
RemainAfterExit=no
ExecStart=/usr/bin/setkeycodes e057 240 e058 240

[Install]
WantedBy=rescue.target
WantedBy=multi-user.target
WantedBy=graphical.target

Then, run the following commands:

sudo systemctl daemon-reload
sudo systemctl enable --now hp-keycodes.service

That fixed it for me, hopefully it helps you (or someone else) as well!

[-] RossoErcole@kbin.social 2 points 1 year ago

no I have an MSI, but I hope in some ways this script helps people that might know more about it.

[-] Thorned_Rose@kbin.social 2 points 1 year ago* (last edited 1 year ago)

Looking at the Arch Wiki, it looks like this is a known issue. Give this solution a go:

https://wiki.archlinux.org/title/MSI_GS65#Wifi_is_hardblocked_(airplane_mode)_after_waking_up_from_suspend

EDIT: on closer look, it's not much of a solution. I assume you've tried restarting the network service and that doesn't work either? Possibly you could automate the airplane mode key twice by triggering that after waking from suspend....

[-] RossoErcole@kbin.social 1 points 1 year ago

I've thinkered with this problem in the past, so I believe I did try restarting the network service, but I'm not sure I did

[-] user224@lemmy.sdf.org 1 points 1 year ago

Do you have Nvidia GPU? I am not sure if that could be related, but sometimes my old laptop would behave funky after resuming it from sleep when using nouveau driver. Although generally I just wouldn't get any video output. But I could never get past login screen, and it sounds unlikely it would affect WiFi, but who knows?

[-] RossoErcole@kbin.social 3 points 1 year ago

Yes I do, 1070, I've posted more details of my system in an answer and in the main thread. But I use the proprietary drivers not nouveau

[-] funkybuddha@mastodon.green -1 points 1 year ago

@RossoErcole @user224 the easiest might be to keep your desktop awake, no matter what. Maybe sth like this is worth a try?

https://flathub.org/apps/io.github.sigmasd.nosleep

[-] user224@lemmy.sdf.org 2 points 1 year ago

That's not very efficient though. And I definitely wouldn't put a running laptop into backpack.

[-] trashxeos@lemmygrad.ml 1 points 1 year ago

Any additional details you can add would go a long way towards troubleshooting. That desktop are you using (ex: Gnome, KDE, etc) and what model of laptop, the full hardware specs including CPU, GPU, WiFi model, etc. Finally, you'll want to look at the system logs to see if there's anything useful in there after resuming from sleep (journalctl).

[-] RossoErcole@kbin.social 1 points 1 year ago

The desktop is Cinnamon, I did include it in the original post too, maybe I should make it clearer.

Laptop is an MSI GS65-Stealth-Thin-8RF

Other System Info:

System:
Kernel: 5.15.0-91-generic x86_64 bits: 64 compiler: gcc v: 11.4.0 Desktop: Cinnamon 5.8.4
tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Machine:
Type: Laptop System: Micro-Star product: GS65 Stealth Thin 8RF v: REV:1.0
serial: \ Chassis: type: 10 serial: \
Mobo: Micro-Star model: MS-16Q2 v: REV:1.0 serial: \
UEFI: American Megatrends v: E16Q2IMS.112 date: 05/21/2019
CPU:
Info: 6-core model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Coffee Lake rev: A cache:
L1: 384 KiB L2: 1.5 MiB L3: 9 MiB
Speed (MHz): avg: 941 high: 1025 min/max: 800/4100 cores: 1: 913 2: 875 3: 1025 4: 867 5: 952
6: 911 7: 979 8: 921 9: 966 10: 994 11: 904 12: 988 bogomips: 52799
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Micro-Star MSI driver: i915
v: kernel ports: active: eDP-1 empty: DP-1,HDMI-A-1 bus-ID: 00:02.0 chip-ID: 8086:3e9b
Device-2: NVIDIA GP104M [GeForce GTX 1070 Mobile] vendor: Micro-Star MSI driver: nvidia
v: 535.129.03 pcie: speed: 2.5 GT/s lanes: 16 ports: active: none empty: DP-2,HDMI-A-2
bus-ID: 01:00.0 chip-ID: 10de:1ba1
Network:
Device-1: Qualcomm Atheros Killer E2500 Gigabit Ethernet vendor: Micro-Star MSI driver: alx
v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 3d:00.0 chip-ID: 1969:e0b1
IF: enp61s0 state: down mac: \
Device-2: Intel Wireless-AC 9260 driver: iwlwifi v: kernel pcie: speed: 5 GT/s lanes: 1
bus-ID: 3e:00.0 chip-ID: 8086:2526
IF: wlp62s0 state: up mac: \
Bluetooth:
Device-1: Intel Wireless-AC 9260 Bluetooth Adapter type: USB driver: btusb v: 0.8 bus-ID: 1-14:3
chip-ID: 8087:0025
Report: hciconfig ID: hci0 rfk-id: 1 state: up address: \ bt-v: 3.0 lmp-v: 5.1
sub-v: 100

[-] trashxeos@lemmygrad.ml 1 points 1 year ago* (last edited 1 year ago)

I must have just missed that originally, I was commenting before coffee.

I see you have the combination graphics (Optimus is what it was originally called IIRC) which has a history of sleep wake issues, that might be a good place to start on the monitor search.

[-] RossoErcole@kbin.social 1 points 1 year ago

I'm trying to get the logs, but it's difficoult to paste them all here, I got a few on this link. But they all seem from 20 October, wierd.
https://sharetext.me/nqz5mfph2y

[-] trashxeos@lemmygrad.ml 1 points 1 year ago

Sorry, I forgot that it doesn't default to latest. Make a share text of journalctl -b instead

[-] RossoErcole@kbin.social 1 points 1 year ago* (last edited 1 year ago)

The lines are quite many, they started at 1pm, while now that I was testing it's 5pm, only to go down by one minute it took quite a long time (definetly more than 1 minute) I'm not sure how to check

EDIT: ok I got to use -n #numer of lines

[-] RossoErcole@kbin.social 1 points 1 year ago
[-] RossoErcole@kbin.social 1 points 1 year ago

@trashxeos I'm kind of lost, did you have any luck looking trough the logs of journalctl?

[-] I_am_10_squirrels@beehaw.org -2 points 1 year ago

It's been a while, but if I recall correctly Linux has always had issues with resuming from suspend. I would set it to not suspend, make closing the lid do nothing.

[-] RossoErcole@kbin.social 4 points 1 year ago

Mhm, but it doesn't sound great. If you forget it's on, you put it in a backpack to then get it out at around 300 degrees. Sounds like a very bad idea.

[-] Frederic@beehaw.org 4 points 1 year ago

what? suspend works flawlessly for years

[-] clmbmb@lemmy.dbzer0.com 1 points 1 year ago

Huh? I've used suspend on Linux for years without issues.

this post was submitted on 15 Dec 2023
31 points (97.0% liked)

Linux

48740 readers
1229 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS