[SOLVED] Laptop cannot resume from sleep

i have just tried 'systemctl hibernate' and i could access the login screen (usually I cannot) and after entering my password, it was the same, screen remained black

EDIT: i did the same with systemctl suspend' and it could only access the login screen for like 2 second, i didnt have time to enter my password, so It was probably the same with hibernate, I was just quicker to enter it.

I found this thread by searching my laptop model https://archived.forum.manjaro.org/t/solved-qca6174-freez-after-suspend

I didnt know it was related to wifi but indeed by turning off network-manager I didnt have the issue anymore.
So i followed your solution by modifying the scripts according to this post and it seems to work fine for now, except network manager stopped once unexpectedly.

I still don't understand why or how this occurs. Shall I fill a bug report somewhere? where?

EDIT: Actually it doesn't seem to work, I had the issue again.

Hey, this came in handy on a little lenovo yoga I was toying with. Couldnt get the darn thing to wake from suspend on kernels higher than 4.4 ... then it decided it wouldnt actually go to sleep (=dead lappy) on 4.4 ... and yup, twas a pesky ath10k_pci card. The systemd services fixed it up :slight_smile:

1 Like

What fixed it exactly? I've just had the issue again, so what I did actually didn't work... I don't know why I thought this was fixed...

First, an easy way to test it is to start with a clean boot ...
Then run
nmcli networking off
Then try to
systemctl suspend
...does it work ? Then go through normal suspend procedures like from the menu or closing the lid.
Do those work with network off?
( you can turn networking back on with nmcli networking on )

1 Like
nmcli networking off

nmcli networking on

Using only those two options in the service will probably only work in the minority of cases. It is a a good way to run a quick test, but generally more is required in a lot of cases.

You may have to try the following as well:

Stop/start network Manager

Unload/load your network adapter

Unload/load your network modules.

There are many examples of systemd suspend services written to correct this issue on the forum here are a bunch of links with related information:

I have many other posts on this topic if you search the forum.

https://archived.forum.manjaro.org/t/kernel-4-19-0-3-not-network-after-suspending-gnome-edition/63544/2

https://archived.forum.manjaro.org/t/wifi-adapter-tp-link-tl-wn823n-must-be-reconnected-for-it-to-work/52968/19

https://archived.forum.manjaro.org/t/surface-pro-1796-wifi-not-resuming-after-suspend/48133/47

https://archived.forum.manjaro.org/t/thinkpad-x230t-wont-suspend-under-kernel-419rc4-4-18-4-17-4-14-4-9/59798/21

Here are some external links with excellent systemd reference material:

The ArchWiki - systemd

Red Hat - systemd-targets

Red Hat - systemd unit files

Systemd manpage

Thank you both for your help, but I'm a bit lost.

The problem is I cannot identified when the problem occurs.

Since I used the fix; it is a lot better, my laptop resumes after suspend but not consistently.
I left it overnight and this morning I could login (It never happened before).
But after letting it on a few hours; same problem occurred. After restarting I had no wifi; I think this is a new issue due to the fix (because it didn't resume from suspend; so it stayed off).

If I do 'systemctl suspend' or 'systemctl hibernate', now everything works fine, whether or not the wifi is on.

Try installing kernel 4.18 with Manjaro Settings Manager. This has worked for some others with this issue.

alright, I'll try that, thanks. Should I revert the fix before?
If so, how? just by deleting the services I have created, right?

You can simply change the extension on the service to ".bak", then you can simply rename it back to its original name if you want to use it again. Disable the service as well.

I tried linux418 and linux414 and systemctl suspend did not work for any of them.

Then I tried to follow your post here:

[g@nitro ~]$ sudo systemctl stop NetworkManager; sleep 2
[sudo] Mot de passe de g : 
[g@nitro ~]$ sudo rfkill block all; sleep 2
[g@nitro ~]$ sudo nmcli r all off; sleep 2
Erreur : NetworkManager n'est pas lancé.
[g@nitro ~]$ sudo ip link set wlp3s0 down; sleep 2
Cannot find device "wlp3s0"
[g@nitro ~]$ sudo modprobe –r iwlmvm; sleep 2
modprobe: FATAL: Module –r not found in directory /lib/modules/4.19.8-2-MANJARO
[g@nitro ~]$ sudo modprobe -r iwldvm; sleep 2
[g@nitro ~]$ sudo modprobe -r iwlwifi; sleep 2
[g@nitro ~]$ sudo ip link set enp0s25 down; sleep 2
Cannot find device "enp0s25"
[g@nitro ~]$ sudo modprobe –r e1000e; sleep 2
modprobe: FATAL: Module –r not found in directory /lib/modules/4.19.8-2-MANJARO
[g@nitro ~]$ sudo systemctl stop bluetooth; sleep 2
[g@nitro ~]$ sudo modprobe –r btusb; sleep 2
modprobe: FATAL: Module –r not found in directory /lib/modules/4.19.8-2-MANJARO

systemctl suspend did work after that.

since $ sudo nmcli r all on; sleep 2; sudo rfkill unblock all gave the error
Erreur : NetworkManager n'est pas lancé.

I restarted it with sudo systemctl start NetworkManager, then did another sudo nmcli r all on; sleep 2; sudo rfkill unblock all

and surpringly, systemctl suspend worked after that

Very nice, some improvement then.

You must alter any script that I post to reflect your adapters ID and your modules. If you run a script custom tailored to others hardware you will rarely find it works with your hardware. The script must be altered, substituting your hardware specifics.

If you run this command it will return the information you need to substitute:

hwinfo --netcard --wlan --bluetooth | grep -Ei "model\:|driver\:|status\:|cmd\:|file\:|detected\:" | grep -v "Config Status" 

so suspend did not work once i tried again, after the successful attempt.

Then I did the same by modifying your commands for my hardware, it did not change the outcome, here are the results:

 [g@nitro ~]$ sudo systemctl stop NetworkManager; sleep 2
[sudo] Mot de passe de g : 
[g@nitro ~]$ sudo rfkill block all; sleep 2
[g@nitro ~]$ sudo nmcli r all off; sleep 2
Erreur : NetworkManager n'est pas lancé.
[g@nitro ~]$ sudo ip link set wlp7s0 down; sleep 2
[g@nitro ~]$ sudo modprobe –r iwlmvm; sleep 2
modprobe: FATAL: Module –r not found in directory /lib/modules/4.19.8-2-MANJARO
[g@nitro ~]$ sudo modprobe -r iwldvm; sleep 2
[g@nitro ~]$ sudo modprobe -r iwlwifi; sleep 2
[g@nitro ~]$ sudo ip link set enp8s0 down; sleep 2
[g@nitro ~]$ sudo modprobe –r e1000e; sleep 2
modprobe: FATAL: Module –r not found in directory /lib/modules/4.19.8-2-MANJARO
[g@nitro ~]$ sudo systemctl stop bluetooth; sleep 2
[g@nitro ~]$ sudo modprobe –r btusb; sleep 2
modprobe: FATAL: Module –r not found in directory /lib/modules/4.19.8-2-MANJARO
[g@nitro ~]$ systemctl suspend 

suspend OK

[g@nitro ~]$ sudo nmcli r all on; sleep 2; sudo rfkill unblock all
Erreur : NetworkManager n'est pas lancé.
[g@nitro ~]$ sudo systemctl start NetworkManager
[g@nitro ~]$ sudo nmcli r all on; sleep 2; sudo rfkill unblock all
[g@nitro ~]$ systemctl suspend 

Suspend OK
then right after:

[g@nitro ~]$ systemctl suspend 

Does not work.

So it seems Suspend works only once, which might explain why I couldn't figure out exactly when the problemn occurs.

You are using the wrong script, and you did not substitute your modules. You need to separate the script into to halves. One script you run before suspending and the other script you run after resuming.

Please post the output of tbe following command:

hwinfo --netcard --wlan --bluetooth | grep -Ei "model\:|driver\:|status\:|cmd\:|file\:|detected\:" | grep -v "Config Status" 
$ hwinfo --netcard --wlan --bluetooth | grep -Ei "model\:|driver\:|status\:|cmd\:|file\:|detected\:" | grep -v "Config Status" 
  Model: "Broadcom NetLink BCM57780 Gigabit Ethernet PCIe"
  Driver: "tg3"
  Device File: enp8s0
  Link detected: no
    Driver Status: tg3 is active
    Driver Activation Cmd: "modprobe tg3"
  Model: "Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter"
  Driver: "ath10k_pci"
  Device File: wlp7s0
  Link detected: yes
    Driver Status: ath10k_pci is active
    Driver Activation Cmd: "modprobe ath10k_pci"
  Model: "Lite-On Bluetooth Device"
  Driver: "btusb"
    Driver Status: btusb is active
    Driver Activation Cmd: "modprobe btusb"

1 Like

Run the following commands before suspending:

su

enter the systems root password.

Then paste in the following commands and execute them:

sudo nmcli r all off
sleep 2
sudo systemctl stop NetworkManager
sleep 2
sudo ip link set wlp7s0 down
sleep 2
sudo modprobe -r ath10k_pci
sleep 2
sudo modprobe -r ath10k_core
sleep 2
sudo rfkill unblock all 
exit 

Run the following commands after resuming:

su

enter the systems root password.

Then paste in the following commands and execute them:

sudo modprobe ath10k_pci
sleep 2
sudo rfkill unblock all
sleep 2
sudo ip link set wlp7s0 up
sleep 2
sudo systemctl start NetworkManager
sleep 2 
sudo rfkill unblock wifi
sleep 2 
sudo nmcli r all on
sleep 2 
exit

Please post the inputs and outputs of all commands.

[nitro g]# su
[nitro g]# sudo nmcli r all off
[nitro g]# sleep 2
[nitro g]# sudo systemctl stop NetworkManager
[nitro g]# sleep 2
[nitro g]# sudo ip link set wlp7s0 down
[nitro g]# sleep 2
[nitro g]# sudo modprobe -r ath10k_pci
[nitro g]# sleep 2
[nitro g]# sudo modprobe -r ath10k_core
[nitro g]# sleep 2
[nitro g]# sudo rfkill unblock all 
[nitro g]# exit 
exit
[nitro g]# systemctl suspend

Suspend worked fine.


[nitro g]# su
[nitro g]# sudo modprobe ath10k_pci
[nitro g]# sleep 2
[nitro g]# sudo rfkill unblock all
[nitro g]# sleep 2
[nitro g]# sudo ip link set wlp7s0 up
[nitro g]# sleep 2
[nitro g]# sudo systemctl start NetworkManager
[nitro g]# sleep 2 
[nitro g]# sudo rfkill unblock wifi
[nitro g]# sleep 2 
[nitro g]# sudo nmcli r all on
[nitro g]# sleep 2 
[nitro g]# exit
exit

Suspend did not work.

Please clarify.

The second group of commands is to be run after coming out of resume. Do you mean that after running the second series of commands that you could not enter suspend again.

That would be normal because you would have to run the first set of commands again before going into suspend again.

By "Suspend did not work" I mean the screen goes black, my keyboard stays lit, but I cannot resume and have to perform hard reset.

I though this was for diagnostic.
Does that mean these are the scripts I have to write as systemd services?
Sorry if i'm a bit lost, I don't think I understand what you mean.

This is for diagnostic purposes, but if a working set of commands is found they will require scripting as a systemd service to have a fix that works.

Modified version:

Run the following commands before suspending:

su

enter the systems root password.

Then paste in the following commands and execute them:

sudo nmcli networking off
sleep 2
sudo systemctl stop NetworkManager
sleep 2
sudo ip link set wlp7s0 down
sleep 2
sudo modprobe -r ath10k_pci
sleep 2
sudo modprobe -r ath10k_core
sleep 2
sudo rfkill unblock all 
exit 

Run the following commands after resuming:

su

enter the systems root password.

Then paste in the following commands and execute them:

sudo modprobe ath10k_pci
sleep 2
sudo rfkill unblock all
sleep 2
sudo ip link set wlp7s0 up
sleep 2
sudo systemctl start NetworkManager
sleep 2 
sudo rfkill unblock wifi
sleep 2 
sudo nmcli networking on
sleep 2 
exit

Please post the inputs and outputs of all commands.

I think you are somewhat misunderstanding how this works. You do not issue a set of commands that fixes the problem permanently. To suspend resume suspend again the full set of commands must be issued repetitively each time. That is why a systemd service is the preferred method as it is executed automatically pre and post suspend.

Forum kindly sponsored by