[PATCH 0/4] Fix forcedeth hibernate/wake-on-lan problems

From: Tobias Diedrich
Date: Sun May 18 2008 - 08:58:03 EST


The following patch series fixes hibernate/wake-on-lan for my
System (Asus M2N-SLI Deluxe, Dual MCP55 Gigabit Ethernet).

See also http://bugzilla.kernel.org/show_bug.cgi?id=8381
"(net forcedeth) doesn't wol on suspend".

Note that so far this is only tested on my system with hibernate
using the 'shutdown' method.

The local setup combines the two onboard nforce gigabit interfaces
eth0 and eth1 into a bridge br0, so it doesn't matter which port I
plug the cable into. The bridging means eth0 and eth1 normally
operate in promiscous mode.

The initial situation (unpatched driver) was as follows:
After a normal boot, turning on wol and sending the system into
hibernate, waking it up with etherwake works as expected.
However, after waking up (be it via wol or via manual poweron)
from hibernate network connectivity is down.

This is because 1) the mac address is now swapped and 2) promiscous
mode is not restored.

The first patch addresses 2)

After this patch wake-on-lan stops working, since in 'shutdown' mode
the suspend callback of the device does not get called again before
poweroff and promiscous mode is apparently incompatible with wol.

So the second patch introduces a shutdown handler, which prepares
the device for wake-on-lan before the system is powered off.

Now waking the system up works again, but the 'swapped mac' problem
is still there.

The reason for this is that in my case the MCP55 is not flagged as
'DEV_HAS_CORRECT_MACADDR' and 'NVREG_TRANSMITPOLL_MAC_ADDR_REV' is
not set by the bios, so in nv_probe during the initial loading of
the driver the MAC address is read in reversed order and
NVREG_TRANSMITPOLL_MAC_ADDR_REV is set.
However during hibernate the device configuration space is lost
(reset do BIOS defaults) and so we get the reversed MAC again, but
resume unconditionally sets NVREG_TRANSMITPOLL_MAC_ADDR_REV, which
means we now have effectively swapped the MAC.

The third patch fixes this by saving and restoring the
configuration space between suspend and resume.

The fourth (optional) patch reorders the code in suspend/resume to
match the order in e100/e1000e more closely, since I think the
latter order is more correct.
For example the configuration space should be saved on suspend even
for devices that are not up.

--
Tobias PGP: http://9ac7e0bc.uguu.de
ããããããååååçãããããããäããããããã
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/