Bug 216558

Summary: networkmanager does not recognize network interface after module has been unloaded/reloaded
Product: [openSUSE] openSUSE 10.2 Reporter: Forgotten User ZhJd0F0L3x <forgotten_ZhJd0F0L3x>
Component: NetworkAssignee: Tambet Ingo <tambet>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: behlert
Version: Beta 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Component Test Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 215208    

Description Forgotten User ZhJd0F0L3x 2006-10-31 12:35:08 UTC
simple testcase:
#!/bin/bash
dbus-send       --system \
                --print-reply \
                --reply-timeout=2000 \
                --dest=org.freedesktop.NetworkManager \
                /org/freedesktop/NetworkManager \
                org.freedesktop.NetworkManager.sleep
echo "rmmod"
rmmod r8169
sleep 3
echo "modprobe"
modprobe r8169
dbus-send       --system \
                --print-reply \
                --reply-timeout=2000 \
                --dest=org.freedesktop.NetworkManager \
                /org/freedesktop/NetworkManager \
                org.freedesktop.NetworkManager.wake
################################################################

This is essentially the same what the now-cool pm-utils do during suspend.
Unfortunately, network manager does no longer find a networking device after this. The only way to get it going again for me is a "rcnetwork restart".
Comment 1 JP Rosevear 2006-10-31 12:40:28 UTC
I would guess this is a duplicate of 207899.  Does hal show the device after you unsuspend?
Comment 2 Robert Love 2006-10-31 13:05:59 UTC
Does look like a dupe.

FWIW, this works for me.  Both my e1000 and my ipw3945 come back after resume.

And I am doing the above steps (have pm-utils installed and have both modules reloaded on suspend/resume).
Comment 3 Forgotten User ZhJd0F0L3x 2006-10-31 13:09:09 UTC
do you use pm-utils to suspend?
you need to add your modules in /etc/pm/config and then call "pm-hibernate".

However, my testcase fails without any suspend involved at all.
I'll check the hal output.
Comment 4 Forgotten User ZhJd0F0L3x 2006-10-31 13:15:01 UTC
ok. I did:
lshal>/tmp/lshal.before
bash /tmp/test.sh
lshal> /tmp/lshal.after
diff /tmp/lshal.*

This is the diff:
root@strolchi:~# diff /tmp/lshal.*
192c192
<   battery.voltage.current = 12516  (0x30e4)  (int)
---
>   battery.voltage.current = 12513  (0x30e1)  (int)
1446c1446
<   net.linux.ifindex = 15  (0xf)  (int)
---
>   net.linux.ifindex = 14  (0xe)  (int)

So this seems to not be the problem.
Comment 5 Forgotten User ZhJd0F0L3x 2006-10-31 13:19:03 UTC
It works, if i put "sleep 5" after "modprobe r8169"

So i think this is what happens:
- nm is put to sleep
- module is removed
- interface vanishes from hal
- module is reloaded
- hal starts detecting the new interface etc.
- in the mean time, nm is woken
- hal is still detecting the interface and stuff. I mean - the HAL code
  is known to be horrible wrt. performance and stuff
- nm sees "no interface"
- hal finally finishes detecting the interface
- somehow, nm does not notice that there has turned up a new interface
- nm never gets to know that there is a new interface.

So i do not know who is to blame, but it surely does not work correctly.
And no, i will not put "sleep 5" into the pm-utils scripts.
Comment 6 JP Rosevear 2006-10-31 17:14:31 UTC

*** This bug has been marked as a duplicate of bug 216495 ***