Bug 8381
Summary: | (net forcedeth) doesn't wol on suspend | ||
---|---|---|---|
Product: | Drivers | Reporter: | Matthieu Baechler (matthieu.baechler) |
Component: | Network | Assignee: | Ayaz Abdulla (aabdulla) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | linux, mailinglist, protasnb, ranma+kernel, rjw, romieu |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.21-rc5 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Bug Depends on: | |||
Bug Blocks: | 7216 | ||
Attachments: | Power management fixes |
Description
Matthieu Baechler
2007-04-27 14:51:10 UTC
Matthieu, do you suspend an interface which is not up ? -- Ueimor I'm seeing the same problem. wol is set on all interfaces: |Settings for eth0: | Supported ports: [ MII ] | Supported link modes: 10baseT/Half 10baseT/Full | 100baseT/Half 100baseT/Full | 1000baseT/Full | Supports auto-negotiation: Yes | Advertised link modes: 10baseT/Half 10baseT/Full | 100baseT/Half 100baseT/Full | 1000baseT/Full | Advertised auto-negotiation: Yes | Speed: 100Mb/s | Duplex: Full | Port: MII | PHYAD: 1 | Transceiver: external | Auto-negotiation: on | Supports Wake-on: g | Wake-on: g | Link detected: yes |Settings for eth1: | Supported ports: [ MII ] | Supported link modes: 10baseT/Half 10baseT/Full | 100baseT/Half 100baseT/Full | 1000baseT/Full | Supports auto-negotiation: Yes | Advertised link modes: 10baseT/Half 10baseT/Full | 100baseT/Half 100baseT/Full | 1000baseT/Full | Advertised auto-negotiation: Yes | Speed: Unknown! (65535) | Duplex: Unknown! (255) | Port: MII | PHYAD: 1 | Transceiver: external | Auto-negotiation: on | Supports Wake-on: g | Wake-on: g | Link detected: no |Settings for eth2: | Supported ports: [ TP ] | Supported link modes: 10baseT/Half 10baseT/Full | 100baseT/Half 100baseT/Full | 1000baseT/Full | Supports auto-negotiation: Yes | Advertised link modes: 10baseT/Half 10baseT/Full | 100baseT/Half 100baseT/Full | 1000baseT/Full | Advertised auto-negotiation: Yes | Speed: 1000Mb/s | Duplex: Full | Port: Twisted Pair | PHYAD: 0 | Transceiver: internal | Auto-negotiation: on | Supports Wake-on: pumbg | Wake-on: g | Current message level: 0x00000033 (51) | Link detected: yes eth0+eth1 are forcedeth, eth2 is a r8169 After poweroff I can wake the machine by sending a magic packet to eth0 or eth2 (no cable attached to eth1). After s2disk I can only wake the machine with eth2, eth0 doesn't react. eth0 is the only interface configured with an IP address: |eth0 Link encap:Ethernet HWaddr 00:17:31:AA:1E:89 | inet addr:192.168.8.241 Bcast:192.168.8.255 Mask:255.255.255.128 | inet6 addr: fe80::217:31ff:feaa:1e89/64 Scope:Link | inet6 addr: fec0:c0a8:800::f1/64 Scope:Site | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | RX packets:1447 errors:0 dropped:0 overruns:0 frame:0 | TX packets:977 errors:0 dropped:0 overruns:0 carrier:0 | collisions:0 txqueuelen:1000 | RX bytes:502379 (490.6 KiB) TX bytes:113890 (111.2 KiB) | Interrupt:21 Base address:0x6000 | |lo Link encap:Local Loopback | inet addr:127.0.0.1 Mask:255.0.0.0 | inet6 addr: ::1/128 Scope:Host | UP LOOPBACK RUNNING MTU:16436 Metric:1 | RX packets:27 errors:0 dropped:0 overruns:0 frame:0 | TX packets:27 errors:0 dropped:0 overruns:0 carrier:0 | collisions:0 txqueuelen:0 | RX bytes:2328 (2.2 KiB) TX bytes:2328 (2.2 KiB) lspci: |00:00.0 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a1) |00:01.0 ISA bridge: nVidia Corporation MCP55 LPC Bridge (rev a2) |00:01.1 SMBus: nVidia Corporation MCP55 SMBus (rev a2) |00:01.2 RAM memory: nVidia Corporation MCP55 Memory Controller (rev a2) |00:02.0 USB Controller: nVidia Corporation MCP55 USB Controller (rev a1) |00:02.1 USB Controller: nVidia Corporation MCP55 USB Controller (rev a2) |00:04.0 IDE interface: nVidia Corporation MCP55 IDE (rev a1) |00:06.0 PCI bridge: nVidia Corporation MCP55 PCI bridge (rev a2) |00:06.1 Audio device: nVidia Corporation MCP55 High Definition Audio (rev a2) |00:08.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a2) |00:09.0 Bridge: nVidia Corporation MCP55 Ethernet (rev a2) |00:0a.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2) |00:0b.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2) |00:0c.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2) |00:0d.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2) |00:0e.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2) |00:0f.0 PCI bridge: nVidia Corporation MCP55 PCI Express bridge (rev a2) |00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration |00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map |00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller |00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control |01:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10) |01:08.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07) |01:08.1 Input device controller: Creative Labs SB Live! Game Port (rev 07) |01:0b.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) |06:00.0 SATA controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02) |06:00.1 IDE interface: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller (rev 02) |07:00.0 VGA compatible controller: ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] |07:00.1 Display controller: ATI Technologies Inc RV370 [Radeon X300SE] Linux melchior 2.6.21.3 #25 PREEMPT Fri Jun 1 18:03:58 CEST 2007 x86_64 GNU/Linux My guess: IIRC on s2disk the devices are shut down using suspend and then reactivated using resume before writing the image to swap. In nv_resume WOL seems to get disabled explicitly: |static int nv_resume(struct pci_dev *pdev) |{ | struct net_device *dev = pci_get_drvdata(pdev); | int rc = 0; | | if (!netif_running(dev)) | goto out; | | netif_device_attach(dev); | | pci_set_power_state(pdev, PCI_D0); | pci_restore_state(pdev); | pci_enable_wake(pdev, PCI_D0, 0); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | rc = nv_open(dev); |out: | return rc; |} Whereas in nv_suspend: |static int nv_suspend(struct pci_dev *pdev, pm_message_t state) |{ | struct net_device *dev = pci_get_drvdata(pdev); | struct fe_priv *np = netdev_priv(dev); | | if (!netif_running(dev)) | goto out; | | netif_device_detach(dev); | | // Gross. | nv_close(dev); | | pci_save_state(pdev); | pci_enable_wake(pdev, pci_choose_state(pdev, state), np->wolenabled); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |out: | return 0; |} So if I'm correct about the order being nv_suspend, nv_resume, write to disk, poweroff, then after "pci_enable_wake(pdev, pci_choose_state(pdev, state), np->wolenabled);" in nv_resume "pci_enable_wake(pdev, PCI_D0, 0);" is called just before the machine gets powered off, which looks to me like it might be the cause? Reproducing: I just did some tests and noticed, that after the first s2disk, wol still works. Only after the second s2disk it stops working. Failure mode: boot -> ethtool -s eth0 wol g -> s2disk -> *wake by wol* -> (1) s2disk -> *doesn't wake by wol, wake with power switch -> goto (1) or -> poweroff -> *doesn't wake by wol* Working: boot -> ethtool -s eth0 wol g -> poweroff -> *wake by wol* So the first s2disk wol still works. second and subsequent s2disk wol doesn't work anymore. "ethtool -s eth0 wol d; ethtool -s eth0 wol g" after s2disk doesn't help When wol stops working for s2disk, it also doesn't work after poweroff. HTH, Tobias Created attachment 11677 [details]
Power management fixes
Can you give the patch above a try ?
It applies against current kernel (post 2.6.22-rc3).
--
Ueimor
Sorry for the delay... With the patch applied on top of 2.6.21.5 (applies fine), wol only works after poweroff and with s2disk it doesn't work at all (as opposed to 'works the first time' like before applying the patch). HTH, Tobias Same with 2.6.22-rc4. I also verified that without the patch on 2.6.22-rc4 wol does work on the first s2disk, but with the patch applied it does not. Any update on this problem? Thanks. Same with 2.6.22.9. If the system is shutdown, WOL works - if the works is in S3 (suspend to ram) mode, WOL doesn't works. Sorry ... now in better english ;-) Shutdown: WOL works S3: WOL doesn't works Can you test 2.6.23-rc9 with the patches from: http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.23-rc9/patches/ applied, please? Can I also use the released 2.6.23 kernel? Does this version already include these patches? (In reply to comment #11) > Can I also use the released 2.6.23 kernel? Yes, please. > Does this version already include these patches? No, it doesn't, but there's a new series against it already, at: http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.23/patches/ Please use it. I'd compiled 2.6.23.1 with patches applied (works without rejects) but they has no effect. WOL doesn't work. Wakeup status is set with ethtool and output shows me the correct set state. Please check if the current mainline kernel does any better ... Test with 2.6.23.9: Doesn't work Problem here is also, that I must use the parameter pci=nomsi on boot so that suspend work. If i doesn't, network will not work on resume and when I remove the forcedeth module, the system will freeze. Update: Same with 2.6.24 .... I found now a solution: I searched for the nic in /proc/acpi/wakeup and enabled the status in my case with echo -n MMAC > /proc/acpi/wakeup Now wake on lan works! Maybe somehow the driver itself should set this state for getting wol working? After finding the ethtool register dump option (ethtool -d, why didn't anyone tell me about this neat debugging option?) I think I solved the problem: Note the byteswapped mac at offset 0a8 after the first s2disk and I just confirmed that "etherwake -i br0 64:C6:AC:31:17:00" will indeed wake up the system if "etherwake -i br0 00:17:31:AC:C6:64" does not work: --- /tmp/dump1 2008-05-17 10:32:09.000000000 +0200 +++ /tmp/dump4 2008-05-17 10:44:19.000000000 +0200 @@ -1,6 +1,6 @@ Offset Values -------- ----- -000: 00 00 00 00 ff 00 00 00 03 00 00 00 ca 03 11 00 +000: 00 00 00 00 ff 00 00 00 03 00 00 00 ca 03 1e 01 010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 030: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -8,17 +8,17 @@ 050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 060: 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 070: ff ff 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 -080: 3e 0f 3b 00 01 00 00 40 00 00 00 00 80 00 7f 00 -090: 1c 06 00 00 01 00 00 00 00 00 00 00 00 7f 00 80 -0a0: 0f 07 16 00 16 00 00 00 00 17 31 aa 1e 89 00 00 -0b0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +080: 3e 0f 3b 00 01 00 00 40 00 00 00 00 20 00 7f 00 +090: 1c 06 00 00 01 00 00 00 00 00 00 00 3b 7f 00 80 +0a0: 0f 07 16 00 16 00 00 00 89 1e aa 31 17 00 00 00 +0b0: 01 00 00 00 00 00 00 00 ff ff ff ff ff ff 00 00 0c0: 00 01 00 10 01 00 00 00 01 00 00 00 01 00 00 00 0d0: 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 0e0: 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 0f0: 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00 100: 00 88 53 7e 00 80 53 7e ff 00 7f 00 00 80 00 00 -110: e8 03 01 00 00 00 00 00 b0 02 00 00 00 88 53 7e -120: c0 80 53 7e 00 00 00 00 00 00 00 00 10 e0 ba 78 +110: e8 03 01 00 00 00 00 00 34 01 00 00 00 88 53 7e +120: c0 80 53 7e 00 00 00 00 00 00 00 00 10 20 f2 7e 130: 1c 06 00 80 0c 88 53 7e 00 80 53 7e 00 80 e0 01 140: 20 41 30 00 00 26 c0 80 00 00 00 00 00 00 00 00 150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -53,7 +53,7 @@ 320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -350: 00 00 00 00 20 00 00 00 8c 22 39 00 00 00 00 00 +350: 00 00 00 00 20 00 00 00 d2 c8 01 00 00 00 00 00 360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 This patch series fixes the bug for me: http://www.tdiedrich.de/~ranma/patches/forcedeth/2.6.26-rc2/ (In reply to comment #19) > This patch series fixes the bug for me: > > http://www.tdiedrich.de/~ranma/patches/forcedeth/2.6.26-rc2/ > Only for '/sys/power/disk' set to 'shutdown' though. For 'platform' mode, the additional acpi magic from comment #17 is required: echo -n MMAC > /proc/acpi/wakeup echo -n MAC1 > /proc/acpi/wakeup Note that a write _toggles_ the corresponding wakeup flag, so I'm now using 'for i in MMAC MAC1; do grep -q "^${i}.*disabled" /proc/acpi/wakeup && echo $i > /proc/acpi/wakeup; done' (My board has two onboard ports, so I need MMAC for one and MAC1 for the other) This should be fixed in the current mainline (2.6.32-rc5), so closing. Please reopen if necessary. |