linux_dsm_epyc7002/drivers/net/ethernet/realtek
Heiner Kallweit fa6821cbf1 r8169: improve WoL handling
WoL handling for the RTL8168 family is a little bit tricky because of
different types of broken BIOS and/or chip quirks.

Two known issues:
1. Network properly resumes from suspend only if WoL is enabled in the chip.
2. Some notebooks wake up immediately if system is suspended and network
   device is wakeup-enabled.

Few patches tried to deal with this:
7edf6d314c ("r8169: disable WOL per default")
18041b5236 ("r8169: restore previous behavior to accept BIOS WoL
settings")

Currently we have the situation that the chip WoL settings as set by
the BIOS are respected (to prevent issue 1), but the device doesn't get
wakeup-enabled (to prevent issue 2).

This leads to another issue:
If systemd is told to set WoL it first checks whether the requested
settings are active already (and does nothing if yes). Due to the chip
WoL flags being set properly systemd assumes that WoL is configured
properly in our case. Result is that device doesn't get wakeup-enabled
and WoL doesn't work (until it's set e.g. by ethtool).

This patch now:
- leaves the chip WoL settings as is (to prevent issue 1)
- keeps the behavior to not wakeup-enable the device initially
  (to prevent issue 2)
- In addition we report WoL as being disabled in get_wol, matching
  that device isn't wakeup-enabled. If systemd is told to enable WoL,
  it will therefore detect that it has to do something and will
  call set_wol.

Of course the user still has the option to override this with
e.g. ethtool.

v2:
- Don't just exclude __rtl8169_get_wol() from compiling, remove it.
v3:
- adjust commit message

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-31 12:50:42 -08:00
..
8139cp.c net: 8139cp: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-01-29 10:03:50 -08:00
8139too.c ethernet/realtek: Replace synchronize_sched() with synchronize_rcu() 2018-11-27 09:21:37 -08:00
atp.c drivers: net: atp: fix various indentation issues 2019-01-16 14:04:22 -08:00
atp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig r8169: add missing Kconfig dependency 2018-08-17 12:24:13 -07:00
Makefile
r8169.c r8169: improve WoL handling 2019-01-31 12:50:42 -08:00