Skip to content

net: phy: fix WoL handling when suspending the PHY

Heiner Kallweit netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 3/32 patches 5 repliesIn review
  2. v2 posting 2/31 patch 2 repliesSuperseded
  3. v2 posting 1/31 patch 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Changes in v2 from the cover letter

- Fix a typo

Patches in v2 posting 3/3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: core: add member wol_enabled to struct net_deviceinclude/linux/netdevice.h net/core/ethtool.c+11 -13 replies
2/2net: phy: fix WoL handling when suspending the PHYdrivers/net/phy/phy_device.c+9 -30 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchFlorian Fainelli
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net v2 0/2] net: phy: fix WoL handling when suspending the PHY

phy_suspend doesn't always recognize that WoL is enabled and therefore suspends the PHY when it should not. First idea to address the issue was to reuse checks used in mdio_bus_phy_may_suspend which check whether relevant devices are wakeup-enabled.
Florian raised some concerns because drivers may enable wakeup even if WoL isn't enabled (e.g. certain USB network drivers).

The new approach focuses on reducing the risk to break existing stuff. We add a flag wol_enabled to struct net_device which is set in ethtool_set_wol(). Then this flag is checked in phy_suspend(). This doesn't cover 100% of the cases yet (e.g. if WoL is enabled w/o explicit configuration), but it covers the most relevant cases with very little risk of regressions.

v2:
- Fix a typo

Heiner Kallweit (2):
net: core: add member wol_enabled to struct net_device
net: phy: fix WoL handling when suspending the PHY

 drivers/net/phy/phy_device.c | 12 +++++++++---
 include/linux/netdevice.h    |  3 +++
 net/core/ethtool.c           |  9 ++++++++-
 3 files changed, 20 insertions(+), 4 deletions(-)
Signature · 1 line
2.19.0