Bug 253977 - Kernel tg3 network driver should not disable Wake On LAN per default
Summary: Kernel tg3 network driver should not disable Wake On LAN per default
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 7
Hardware: i686
OS: Linux
low
low
Target Milestone: ---
Assignee: Andy Gospodarek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-08-23 12:11 UTC by Christian Mandery
Modified: 2014-06-29 22:59 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-16 01:20:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
tg3-wol.patch (735 bytes, patch)
2007-08-23 15:44 UTC, Andy Gospodarek
no flags Details | Diff

Description Christian Mandery 2007-08-23 12:11:34 UTC
Description of problem:
In kernel sourcecode file drivers/net/tg3.c:
11072 /* By default, disable wake-on-lan.  User can change this
11073  * using ETHTOOL_SWOL.
11074 */
11075 tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE;

This line reset Wake On LAN settings for tg3 network cards during every boot
process.

For example, you enable Wake On LAN on a machine using ethtool then shutdown the
system and start it again using Wake On LAN. But now, the linux driver disables
Wake On LAN. Effectively you have to enable WOL again after each boot (in an
initscript or cronjob) to make sure that it stays enabled.

Fedora/RHEL should remove this "feature"/bug from their kernels to allow
reasonable use of Wake On LAN with tg3 network adapters.

Version-Release number of selected component (if applicable):
Every upstream kernel up to latest git version.

Steps to Reproduce:
1. On a computer with tg3 network adapter, set WOL active with ethtool eth0 wol.
2. Shutdown.
3. Send Magic Packet. Machine boots up.
4. Shutdown.
5. Send Magic Packet.
  
Actual results:
Machine stays down.

Expected results:
Machine should boot up again.

Comment 1 John W. Linville 2007-08-23 12:57:29 UTC
ETHTOOL_OPTS="wol g"

Why is adding this to /etc/sysconfig/network-scripts/ifcfg-eth0 insufficient?

Comment 2 Christian Mandery 2007-08-23 13:05:18 UTC
Yes, that would work but it seems- like the solution with the initscript or a
cronjob- more like a hack to me to compensate for the fact that the tg3 drivers
tampers with settings that it should not touch (without user request).

In fact it will not work when the system does not boot up completely or the
network-script is not run due to some problem. It will also not work if you are
running a Fedora/RHEL installation or using a Fedora-based system as a rescue
system (which is critical if you boot the rescue image using PXE/WOL like I do
and expect the system to be still WOL-enabled after you shutdown the rescue system).

Shouldn't it be the default of the Linux kernel to change as few things as
possible permanently on a system so that the system has the same settings after
shutdown that is has before Linux booted?

Comment 3 Andy Gospodarek 2007-08-23 15:21:50 UTC
It would be great if we could simply read hardware parameters and set the driver
WOL state based on whether or not WOL is enabled in the hardware, but right now
it doesn't appear the driver works that way.

Comment 4 Andy Gospodarek 2007-08-23 15:26:03 UTC
"works that way" should really be "works that way right now" :-)


Comment 5 Andy Gospodarek 2007-08-23 15:44:05 UTC
Created attachment 169192 [details]
tg3-wol.patch

This is completely untested, but it might resolve your issue (the idea is at
least	correct).

Comment 6 Andy Gospodarek 2007-08-23 16:41:45 UTC
I just tested this patch and it doesn't seem to work on my 5755 card.  Reading
the MAC_MODE register when coming out of reboot doesn't show the bit 'magic
packet' bit set, so this might be a register that isn't persistent across reboots.

Comment 7 Andy Gospodarek 2007-10-10 14:01:13 UTC
Not all of the tg3 hardware may save WoL state when powered-up -- it may only be
a setting that can be written while the device is powered.

Adding Michael to the CC list to see if he's got anything more to add.

Comment 8 Michael Chan 2007-10-10 14:15:05 UTC
We have a patch that will set WoL according to the NVRAM's setting by default.  
The user can still override it but the initial setting will match NVRAM's 
setting.  We should be pushing that upstream soon.

Comment 9 Andy Gospodarek 2007-10-10 14:40:22 UTC
Thanks, Michael!  I figured if anyone would know, you'd be the one!

Comment 10 Michael Chan 2007-10-11 03:01:33 UTC
The following patch posted today should fix this problem:

http://marc.info/?l=linux-netdev&m=119206359520255&w=2

Comment 11 Christopher Brown 2008-01-13 18:17:13 UTC
Hello,

I'm reviewing this bug as part of the kernel bug triage project, an attempt to
isolate current bugs in the Fedora kernel.

http://fedoraproject.org/wiki/KernelBugTriage

Please could those experiencing the issue confirm or deny whether the issue has
been resolved for them with the above patch.

If the problem no longer exists then please close this bug or I'll do so in a
few days if there is no additional information lodged.

Comment 12 Helge Deller 2008-01-14 10:06:47 UTC
The patch posted in comment #10 seems to have been accepted upstream (it's in 
2.6.24-rc7). Will Red Hat include it in FC7 (and above) kernels as well?
PS: I didn't tested the patch myself.

Comment 13 Christopher Brown 2008-01-14 18:28:23 UTC
Helge,

I have done a scratch build with the patch included in koji for you to test if
you wish:

http://koji.fedoraproject.org/koji/taskinfo?taskID=347248

Cheers
Chris

Comment 14 Uwe Menges 2008-01-15 18:10:30 UTC
Chris,

I just tested the kernel you kindly provided, it works great!

Thanks a ton!

Comment 15 Christopher Brown 2008-01-16 01:20:44 UTC
Thanks for testing and good to know Uwe :)

I don't think the kernel team are anticipating carrying this as 2.6.24 (which
includes the patch) is just about to be released so I will close as NEXTRELEASE
and Helge can re-open should he feel the need.

Comment 16 Helge Deller 2008-01-16 09:13:14 UTC
That's fine with me. Thanks all.


Note You need to log in before you can comment on or make changes to this bug.