You are not logged in.

#1 2015-06-24 13:16:21

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

No network connection after resume from suspend to ram

Hi.

I would like to ask for help. Recently i was able to fix my problem with suspend to RAM (since the beginning - it just didn't want to work. I found out that the culprit was bios - newest from Gigabyte solved problem with freezing after suspend to RAM) but now i see that after resume from it, i don't have internet acces. I see red X icon in network applet on my taskbar. I would like to ask you for two thing:
-how to fix it
-i would like to learn much more, so how to diagnose it

I have workaround for it, but it is not "clean way" - after resume from suspend i do:

sudo rmmod r8169
sudo modprobe r8169

and after that in network applet i see that X went away, internet is being connected again.

I tried to add to /etc/pm/config.d/unload_modules

SUSPEND_MODULES="r8169"

but it does not work. I think that it is only for suspend to disk (after suspend to disk and resume from suspend to disk internet works ok, it is being reconnected".

I tried to add to /etc/pm/sleep.d/

with something like this:

[firekage@arch_desktop sleep.d]$ cat 89r8169_reload_fix 
#!/bin/sh

case "$1" in
    thaw|resume) 
    service network-manager stop
    modprobe -r r8168
    modprobe r8168
    service network-manager start 
        ;;
    *) exit $NA
        ;;
esac


exit 0

[firekage@arch_desktop sleep.d]$ 

and something like this:

[firekage@arch_desktop sleep.d]$ cat 90r8169_reload_fix 
#!/bin/sh

case "$1" in
    hibernate|suspend)
        service network-manager stop
        modprobe -r r8169
        ;;
    thaw|resume) 
        modprobe r8169
        service network-manager start 
        ;;
esac

[firekage@arch_desktop sleep.d]$ 

but it does not work when i do resume from suspend to RAM.

Could somebody help?

My network

[firekage@arch_desktop sleep.d]$ lspci | grep -i net
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
[firekage@arch_desktop sleep.d]$ 

Driver:

[firekage@arch_desktop sleep.d]$ lsmod | grep r8169
r8169                  81920  0 
mii                    16384  1 r8169
[firekage@arch_desktop sleep.d]$ 

Last edited by firekage (2015-06-28 21:23:51)

Offline

#2 2015-06-24 16:26:41

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: No network connection after resume from suspend to ram

Do you actually use pm-utils (pm-suspend/pm-hibernate) to suspend and hibernate?

Do you use systemd as init/daemon manager or something else? What WM/DE/panel do you use? How do you suspend/hibernate?

Offline

#3 2015-06-24 20:52:39

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

lucke wrote:

Do you actually use pm-utils (pm-suspend/pm-hibernate) to suspend and hibernate?

Do you use systemd as init/daemon manager or something else? What WM/DE/panel do you use? How do you suspend/hibernate?

1. Yes, i use pm-utils because of using hibernation that goes to selected hdd.
2. Yes, i use systemd. I use KDE4. I suspend by clicking on KDE icons in K > Finish > suspend/hibernate.

Last edited by firekage (2015-06-24 20:55:49)

Offline

#4 2015-06-24 22:39:54

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: No network connection after resume from suspend to ram

KDE and others DEs use systemd nowadays on Arch, thus they call "systemctl hibernate" or "systemctl suspend". Read man systemd-sleep - you can put a script doing what you want in /usr/lib/systemd/system-sleep/.

By default It's the kernel line in your bootloader that determines where the hibernation image goes, so "systemctl hibernate" should work similarly to "pm-utils hibernate", unless you use some different backend (not the default, kernel one) in pm-utils.

Last edited by lucke (2015-06-24 22:40:54)

Offline

#5 2015-06-26 18:21:23

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

It does not matter which unit i use to do a sleep. If i use systemctl-suspend it goes to sleep, and after wake up i still don't have internet connection, have to rmmod and modprobe r8169. It is not something with pm-utils, systemd or their configs.

Last edited by firekage (2015-06-26 18:21:58)

Offline

#6 2015-06-26 18:29:58

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: No network connection after resume from suspend to ram

pm-suspend/hibernate runs scripts in /etc/pm/sleep.d/. systemctl suspend/hibernate runs scripts in /usr/lib/systemd/system-sleep/. If you use pm-utils to suspend/hibernate, then it should reload the module (if the script is executable). It probably won't restart networkmanager, as you use Debian/Ubuntu syntax, not systemd's. If you want to have such a script executed on suspension/hibernation through KDE's logout menu, then you will have to create a similar (check the man) script in /usr/lib/systemd/system-sleep.

[20:32:10][root@serenity]# ls /usr/lib/systemd/system-sleep/script.sh -l                                         [/home/lucke]
-rwxr-xr-x 1 root root 132 Sep 10  2013 /usr/lib/systemd/system-sleep/script.sh
[20:32:34][root@serenity]# cat /usr/lib/systemd/system-sleep/script.sh                                           [/home/lucke]
#!/bin/sh

case "$1" in
  pre)
    #modprobe -r r8187se
    ;;
  post)
    #modprobe r8187se
    hdparm -B 254 /dev/sda
    ;;
esac

Last edited by lucke (2015-06-26 18:33:21)

Offline

#7 2015-06-27 12:48:05

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

I checked /usr/lib/systemd/system-sleep/suspend-modules and i have something like this here:

firekage@arch_desktop system-sleep]$ cat suspend-modules 
#!/bin/bash

case $1 in
    pre)
        for mod in $(</etc/suspend-modules.conf); do
            rmmod $mod
        done
    ;;
    post)
        for mod in $(</etc/suspend-modules.conf); do
            modprobe $mod
        done
    ;;
esac
[firekage@arch_desktop system-sleep]$

I should only add after rmmod r8169 and that's all? You have .sh at the end of unit name, i don't - have to change it? also, in your script you have commented out "rrmod" or it is root privileages?

Last edited by firekage (2015-06-27 12:50:29)

Offline

#8 2015-06-27 13:05:11

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: No network connection after resume from suspend to ram

I don't know where that file came from, but with it active, you can put "r8169" in /etc/suspend-modules.conf to have it reloaded. The file name shouldn't matter, the file has to be executable.

In my script rmmod is commented out, I don't reload the module anymore.

Offline

#9 2015-06-27 13:16:05

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

Ok, will check it. Thanks. I will write later if this is ok and works or not.

BTW - why "something" in /etc/ not in specific place? It will be readed by system?

Offline

#10 2015-06-27 16:58:51

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

Ok, i checked /usr/lib/systemd/system-sleep/ and changed suspend-modules files that is herer - i added r8169 and also added what you suggested to /etc/suspend-modules.conf and either the first one or the second works. I have acces to internet after suspend to RAM.

Thank you very much!

Edit:
It looks that problem is still present. I did a suspend to RAM with kde button and after wake, no network. After that i see red "?" sign in network manager applet on kde taskbar. There is no interfaces here.

Last edited by firekage (2015-06-28 21:25:10)

Offline

#11 2015-07-04 20:53:45

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

I think that it is related to power management or power saving options in linux with r8169. I did under Windows quick and simple check on, and if these options are enabled, than after resume from suspend to ram there is no network connection too:

energy efficient ethernet: on
ethernet energetically efective: on
magic packet: on
shutdown to wake up when actualize network: on

I'm not sure if these options are properly translated to english. With these options disabled in Windows, after resume from suspend to ram THERE IS NETWORK connection. Could somebody tell me how to disable it on Arch or how to completly disable power management for ethernet? Tried to search on www, can't find anything at all.

Last edited by firekage (2015-07-04 20:55:11)

Offline

#12 2015-07-13 18:01:20

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

I found out that restarting NetworkManager.service allow me to connect to internet. Applet is being "reloaded" and my devices are being found.


Could somebody tell me how to do it automatically? I put these:

#/etc/pm/sleep.d/network-manager-restart
#!/bin/sh

case "${1}" in
    resume|thaw)
        service network-manager restart;;
esac

but this does not work. I have to manually restart service.  I did also this:

[firekage@arch_desktop sleep.d]$ cat 91network-manager-resume.bak 
#!/bin/sh

# This script gets NetworkManager out of suspend.
case $1 in
     suspend|suspend_hybrid|hibernate)
    # No need to do anything here.
        ;;
     resume|thaw)
    nmcli nm sleep false
        ;;
esac

it also, does not work.


I did this:

[firekage@arch_desktop sleep.d]$ cat 89r8169_reload_fix 
#!/bin/sh

case "$1" in
    thaw|resume) 
    service network-manager stop
    modprobe -r r8169
    modprobe r8169
    service network-manager start 
        ;;
    *) exit $NA
        ;;
esac


exit 0

Does not work. Did that:

#!/bin/sh

case "$1" in
    hibernate|suspend)
        service network-manager stop
        modprobe -r r8169
        ;;
    thaw|resume) 
        modprobe r8169
        service network-manager start 
        ;;
esac

The same. How to restart NetworkManager.service by system?

Last edited by firekage (2015-07-13 18:23:20)

Offline

#13 2015-07-16 22:03:02

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: No network connection after resume from suspend to ram

Today i did an upgrade of system packages. I don't know it this helped, or not, but after suspend to ram, and wake it up from suspend to ram, i have internet acces. Don't know if my script, that i posted earlier, helped, but it works. Today was also update of networkmanager package.

After wake it up networkmanager applet does not show "?" sign and dmesg shows that link (en3ps0) is ready. Earlier dmesg after suspend to ram and resume showed "link is down" or something similar.

Last edited by firekage (2015-07-16 22:09:18)

Offline

Board footer

Powered by FluxBB