All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] r8169: disable WOL per default
@ 2018-02-22 20:22 Heiner Kallweit
  2018-02-23 17:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2018-02-22 20:22 UTC (permalink / raw)
  To: Realtek linux nic maintainers, David Miller; +Cc: netdev

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:
8f9d5138035d "r8169: remember WOL preferences on driver load" prefers
to preserve what the BIOS may have set, whilst bde135a672bf
"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 <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index c16b97a56..91a03d575 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -8512,11 +8512,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	tp->txd_version = rtl_chip_infos[chipset].txd_version;
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
-	RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
-	RTL_W8(Config5, RTL_R8(Config5) & (BWF | MWF | UWF | LanWake | PMEStatus));
 	tp->features |= rtl_try_msi(tp, cfg);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 
+	/* override BIOS settings, use userspace tools to enable WOL */
+	__rtl8169_set_wol(tp, 0);
+
 	if (rtl_tbi_enabled(tp)) {
 		tp->set_speed = rtl8169_set_speed_tbi;
 		tp->get_link_ksettings = rtl8169_get_link_ksettings_tbi;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] r8169: disable WOL per default
  2018-02-22 20:22 [PATCH net-next] r8169: disable WOL per default Heiner Kallweit
@ 2018-02-23 17:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-02-23 17:29 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, netdev

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Thu, 22 Feb 2018 21:22:40 +0100

> 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:
> 8f9d5138035d "r8169: remember WOL preferences on driver load" prefers
> to preserve what the BIOS may have set, whilst bde135a672bf
> "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 <hkallweit1@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-23 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 20:22 [PATCH net-next] r8169: disable WOL per default Heiner Kallweit
2018-02-23 17:29 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.