Hibernation on 4.15 kernel and ath10 firmware

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

I'm looking for a way to automate the enabling and disabling of the network. Kernel 4.8 was last kernel the ath10 firmware didn't crash on entering hibernation. But if the network was disabled before enter hibernation the laptop will successful enter and exit hibernation.

Option B is go back to kernel 4.4 if it's available for LM19
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

It looks like it's kernel 4.4 for a while yet. I tried the follow scripts but couldn't get them to work

SLEEP

Code: Select all

sudo -H xed /etc/systemd/system/wifi-sleep.service

Code: Select all

[Unit]
Description=Stop networkmanager before sleep
Before=suspend.target
Before=hibernate.target
Before=hybrid-sleep.target

[Service]
Type=oneshot
ExecStart=/bin/systemctl stop network-manager.service

[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

Code: Select all

systemctl enable  wifi-sleep.service
AWAKE

Code: Select all

sudo -H xed /etc/systemd/system/wifi-resume.service

Code: Select all

[Unit]
Description=Enable networkmanager after sleep
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target

[Service]
Type=oneshot
ExecStart=/bin/systemctl start network-manager.service

[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

Code: Select all

systemctl enable  wifi-resume.service
gm10

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by gm10 »

This should do it:

Create a script in /lib/systemd/system-sleep like this

Code: Select all

#!/bin/sh
case "$1" in
    pre)
        nmcli networking off
        ;;
    post)
        nmcli networking on
        ;;
esac
Don't forget to make it executable.

Even cleaner is probably to just unload the kernel driver that's creating the issue. Do inxi -N to find the driver name, then substitute it for <kernelDriver> in the below and use that for the script instead:

Code: Select all

#!/bin/sh
case "$1" in
    pre)
        modprobe -r <kernelDriver>
        ;;
    post)
        modprobe <kernelDriver>
        ;;
esac
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

Thanks, I'll give a try.


P.S
I would argue my last post was not a hijacking, AndrewSmith and I are both looking for a similar if not the same solution to a problem.
gm10

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by gm10 »

Appoloin wrote: Fri Jul 27, 2018 1:04 pm P.S
I would argue my last post was not a hijacking, AndrewSmith and I are both looking for a similar if not the same solution to a problem.
His issue was trying to find a solution on how to run a script pre/post sleep.

You already had a solution for that but are struggling with a kernel driver.

So at the end of the day it's really quite different I think even though I basically gave you the same template I gave him, except for the actual command, but that's because it's just simpler than the implementation you've been working on. At least as long as my solution works for you, but it should. :)
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

It kind of worked, using "modprobe -r ath10k_pci" has stopped the firmware from crashing but there's a new error in the log

Code: Select all

Freezing user space processes ... 
Freezing of tasks failed after 20.006 seconds (5 tasks refusing to freeze, wq_busy=0):
wpa_supplicant  D    0   957      1 0x00000004

This like play whack-a-mole.
gm10

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by gm10 »

Does this also happen with the first version of the script I posted that turns networking off? If not, just use that.

Otherwise change the other script like this:

Code: Select all

#!/bin/sh
case "$1" in
    pre)
        systemctl stop wpa_supplicant
        modprobe -r ath10k_pci
        ;;
    post)
        modprobe ath10k_pci
        systemctl start wpa_supplicant
        ;;
esac
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

"nmcli networking" didn't work, the log still showed the firmware was crashing
gm10

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by gm10 »

Appoloin wrote: Sun Jul 29, 2018 7:45 am "nmcli networking" didn't work, the log still showed the firmware was crashing
Oh interesting, because you had said in the first post that disabling the network did let you hibernate successfully. how did you disable it then when you did it manually?
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

gm10 wrote: Sun Jul 29, 2018 7:51 am Oh interesting, because you had said in the first post that disabling the network did let you hibernate successfully. how did you disable it then when you did it manually?
I used the network applet to disable the wifi. "systemctl stop wpa_supplicant" didn't work.

Code: Select all

Freezing of tasks failed after 20.010 seconds (6 tasks refusing to freeze, wq_busy=0):
wpa_supplicant  D    0   902      1 0x00000004
gm10

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by gm10 »

Oh weird. Wifi off from the applet should be including in the complete networking off. nmcli radio wifi off would only turn the wifi off, but it should really be the same thing.

Because of that I'm wondering if this is a timing issue. You could try to add a sleep 5 to the script after turning the networking off in the script.
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

I tried "nmcli networking off" with sleep 5 and the firmware crashed,
gm10

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by gm10 »

Appoloin wrote: Mon Jul 30, 2018 5:30 pm I tried "nmcli networking off" with sleep 5 and the firmware crashed,
Hmm. I honestly don't know at this point what the difference could be between manually disabling networking and doing it via the command line. Might have to look at the sources for that.
ajgringo619

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by ajgringo619 »

Have you considered disabling NetworkManager and using /etc/network/interfaces to control your network devices? This solved my suspend problem; I would think that suspend/hibernate are related in how they shutdown devices.
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

You mean ifdown and ifup
ajgringo619

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by ajgringo619 »

Yes - should have clarified that /etc/network/interfaces is the config file, not the actual command(s).
Appoloin
Level 3
Level 3
Posts: 174
Joined: Sun Apr 28, 2013 3:58 am

Re: Hibernation on 4.15 kernel and ath10 firmware

Post by Appoloin »

For a while I've been using the 4.4 kernel but after an update to wpasupplicant this kernel/firmware in now affected by this bug
Locked

Return to “Installation & Boot”