On Dec 9 23:43, Francois Romieu wrote: > Corinna Vinschen <vinsc...@redhat.com> : > [...] > > This patch is supposed to fix this behaviour. If LanWake is 0, the > > function now returns 0. Thus ethtool correctly reports "Wake-on: d". > > Can you turn it into a DMI controlled one (something like > drivers/net/ethernet/marvell/skge.c use of dmi_check_system)
I could do this (after I could lay my hands on such a board, that is), but I'm not convinced that this makes a lot of sense for two reasons. > in order to > avoid a global change of behavior ? 1. There is no global change in behaviour. The usual way to handle the WoL flags is to set the affected method flags and additionally set LanWake if any of the method flags is set. The fact that the method flags don't enable WoL without also settting the LanWake flag is documented. __rtl8169_get_wol not reflecting this is a bug. The code lazily assumes that checking the WoL method flags is sufficient while in fact it isn't. __rtl8169_set_wol sets the LanWake flag accordingly, but that doesn't mean the driver may assume that the flags haven't been set differently. I can easily hack the driver to set LanWake to 0 and ethtool would still happily report WoL is active. That's plain wrong. 2. While we now know a single board which neglects to set the LanWake flag, that doesn't mean there aren't other boards out there doing the same. On top of that, the state of the NIC registers in terms of WoL are *not* board-specific. They are regular NIC registers which are just set in a combination which the driver in it's current state evaluates wrongly. It doesn't matter who and why the flags have been set that way. The driver should reflect the actual state, and that requires to check for LanWake. For those reasons I think that my fix is the right thing to do. > Btw it's probably time to emit some warning during driver probe if wol > bits are not consistent with LanWake. That's a good idea. I'll propose a followup patch with this addition. Thanks, Corinna
pgp6boYAPgk5h.pgp
Description: PGP signature