Skip to content

Commit 7edf6d3

Browse files
hkallweitdavem330
authored andcommitted
r8169: disable WOL per default
Currently, if BIOS enables WOL in the chip, settings are inconsistent because the device isn't marked as wakeup-enabled (if not done explicitly via userspace tools). This causes issues with suspend/ resume because mdio_bus_phy_may_suspend() checks whether device is wakeup-enabled. In detail MDIO bus access in phy_suspend() can fail because the MDIO bus is disabled. In the history of the driver we find two competing approaches: 8f9d513 "r8169: remember WOL preferences on driver load" prefers to preserve what the BIOS may have set, whilst bde135a "r8169: only enable PCI wakeups when WOL is active" disabled PCI wakeup per default to work around a bug on one platform. Seems like nobody complained after the latter patch about non-working WOL, what makes me think that nobody uses WOL w/o configuring it explicitly. My opinion: Vast majority of users doesn't use WOL even if the BIOS enables it in the chip. And having WOL being active keeps the PHY(s) from powering down if being idle. If somebody needs WOL, he can enable it during boot, e.g. by configuring systemd.link/WakeOnLan. Therefore, to make WOL consistent again, disable it per default. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4618245 commit 7edf6d3

File tree

1 file changed

+3
-2
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+3
-2
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8512,11 +8512,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
85128512
tp->txd_version = rtl_chip_infos[chipset].txd_version;
85138513

85148514
RTL_W8(Cfg9346, Cfg9346_Unlock);
8515-
RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
8516-
RTL_W8(Config5, RTL_R8(Config5) & (BWF | MWF | UWF | LanWake | PMEStatus));
85178515
tp->features |= rtl_try_msi(tp, cfg);
85188516
RTL_W8(Cfg9346, Cfg9346_Lock);
85198517

8518+
/* override BIOS settings, use userspace tools to enable WOL */
8519+
__rtl8169_set_wol(tp, 0);
8520+
85208521
if (rtl_tbi_enabled(tp)) {
85218522
tp->set_speed = rtl8169_set_speed_tbi;
85228523
tp->get_link_ksettings = rtl8169_get_link_ksettings_tbi;

0 commit comments

Comments
 (0)