Bug 253977 - Kernel tg3 network driver should not disable Wake On LAN per default
Kernel tg3 network driver should not disable Wake On LAN per default
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
7
i686 Linux
low Severity low
: ---
: ---
Assigned To: Andy Gospodarek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-23 08:11 EDT by Christian Mandery
Modified: 2014-06-29 18:59 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-15 20:20:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Christian Mandery 2007-08-23 08:11:34 EDT
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 08:57:29 EDT
ETHTOOL_OPTS="wol g"

Why is adding this to /etc/sysconfig/network-scripts/ifcfg-eth0 insufficient?
Comment 2 Christian Mandery 2007-08-23 09:05:18 EDT
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 11:21:50 EDT
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 11:26:03 EDT
"works that way" should really be "works that way right now" :-)
Comment 5 Andy Gospodarek 2007-08-23 11:44:05 EDT
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 12:41:45 EDT
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 10:01:13 EDT
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 10:15:05 EDT
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 10:40:22 EDT
Thanks, Michael!  I figured if anyone would know, you'd be the one!
Comment 10 Michael Chan 2007-10-10 23:01:33 EDT
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 13:17:13 EST
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 05:06:47 EST
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 13:28:23 EST
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 13:10:30 EST
Chris,

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

Thanks a ton!
Comment 15 Christopher Brown 2008-01-15 20:20:44 EST
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 04:13:14 EST
That's fine with me. Thanks all.

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