Skip to content

net: phy: improve and simplify phylib state machine

Heiner Kallweit netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net: phy: remove useless check in state machine case PHY_NOLINKdrivers/net/phy/phy.c+0 -110 replies
2/5net: phy: remove useless check in state machine case PHY_RESUMINGdrivers/net/phy/phy.c+1 -120 replies
3/5net: phy: add phy_check_link_statusdrivers/net/phy/phy.c+40 -300 replies
4/5net: phy: remove state PHY_ANdrivers/net/phy/phy.c include/linux/phy.h+1 -450 replies
5/5net: phy: use phy_check_link_status in more places in the state machinedrivers/net/phy/phy.c+5 -480 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/5] net: phy: improve and simplify phylib state machine

This patch series is based on two axioms:

- During autoneg a PHY always reports the link being down

- Info in clause 22/45 registers doesn't allow to differentiate between these two states:
1. Link is physically down
2. A link partner is connected and PHY is autonegotiating In both cases "link up" and "aneg finished" bits aren't set. One consequence is that having separate states PHY_NOLINK and PHY_AN isn't needed.

By using these two axioms the state machine can be significantly simplified.

Heiner Kallweit (5):
net: phy: remove useless check in state machine case PHY_NOLINK
net: phy: remove useless check in state machine case PHY_RESUMING
net: phy: add phy_check_link_status
net: phy: remove state PHY_AN
net: phy: use phy_check_link_status in more places in the state machine

 drivers/net/phy/phy.c | 172 +++++++++++-------------------------------
 include/linux/phy.h   |  19 +----
 2 files changed, 46 insertions(+), 145 deletions(-)
Signature · 1 line
2.19.1