[PATCH net v2 0/3] net: phy: smsc: use IRQ + relaxed polling to fix missed link-up

Oleksij Rempel posted 3 patches 3 months ago
There is a newer version of this series
drivers/net/phy/phy.c  | 18 +++++++++++-------
drivers/net/phy/smsc.c | 40 ++++++++++++++++++++++++++++++++++++++++
include/linux/phy.h    | 12 ++++++++++--
3 files changed, 61 insertions(+), 9 deletions(-)
[PATCH net v2 0/3] net: phy: smsc: use IRQ + relaxed polling to fix missed link-up
Posted by Oleksij Rempel 3 months ago
This series makes the SMSC LAN8700 (as used in LAN9512 and similar USB
adapters) reliable again in configurations where it is forced to 10 Mb/s
and the link partner still advertises autonegotiation.

In this scenario, the PHY may miss the final link-up interrupt, causing
the network interface to remain down even though a valid link is
present.

To address this:

Patch 1 – phylib: Enable polling if the driver implements
get_next_update_time(). This ensures the state machine is active even
without update_stats().

Patch 2 – phylib: Allow drivers to return PHY_STATE_IRQ to explicitly
disable polling.

Patch 3 – smsc: Implement get_next_update_time() with adaptive 1 Hz
polling for up to 30 seconds after the last interrupt in the affected
10M autoneg-off mode.  All other configurations rely on IRQs only.

Testing:

The LAN9512 (LAN8700 core) was tested against an Intel I350 NIC using
baseline, parallel-detection, and advertisement test suites. All
relevant tests passed.

Changes in v2:
- Introduced explicit disable polling via PHY_STATE_IRQ
- Changed the workaround logic to apply 1 Hz polling only for 30 seconds
  after the last IRQ
- Dropped relaxed 30s polling while link is up
- Reworded commit messages and comments to reflect updated logic
- Split core changes into two separate patches for clarity

Thanks,
Oleksij Rempel

Oleksij Rempel (3):
  net: phy: enable polling when driver implements get_next_update_time
  net: phy: allow drivers to disable polling via get_next_update_time()
  net: phy: smsc: recover missed link-up IRQs on LAN8700 with adaptive
    polling

 drivers/net/phy/phy.c  | 18 +++++++++++-------
 drivers/net/phy/smsc.c | 40 ++++++++++++++++++++++++++++++++++++++++
 include/linux/phy.h    | 12 ++++++++++--
 3 files changed, 61 insertions(+), 9 deletions(-)

--
2.39.5