Skip to content

TG-641: 10g copper eth1 not recover after down/up#87

Closed
paul-sirin wants to merge 4 commits into
tg-v6.18-ath12k-nextfrom
bugfix/TG-641-10g-copper-not-recover-down-up
Closed

TG-641: 10g copper eth1 not recover after down/up#87
paul-sirin wants to merge 4 commits into
tg-v6.18-ath12k-nextfrom
bugfix/TG-641-10g-copper-not-recover-down-up

Conversation

@paul-sirin
Copy link
Copy Markdown

This PR contains follow-up fix for issue in 88x3310 PHY driver with more relaxed timings for SWRST command execution

…TG-641)

On 88X3310 with PTP enabled, TX and RX stop working from the second ip link set
up onwards. The root cause is a race in mv3310_power_up(): the function issues
a software reset (SWRST, MV_V2_PORT_CTRL bit 15) followed by msleep(100), but
when resume is called again before the previous SWRST has fully completed, the
new SWRST is issued while bit 15 is still asserted by the PHY. This corrupts
the reset sequence and leaves the data path in a broken state.

Fix this by polling MV_V2_PORT_CTRL bit 15 before issuing SWRST, waiting up to
200ms for the PHY to signal it is ready for a new reset (bit 15 = 0). Profiling
showed that in normal operation the wait is under 10ms, but occasionally
reaches ~157ms. If the poll times out, a warning is emitted and execution
continues rather than aborting the power-up sequence.

This is only applied to 88X3310 with firmware >= 0.3.0.0, matching the existing
guard for the SWRST
…e (TG-641)

Issue caused TX/RX to fail on the second and subsequent ip-link-down/up
cycles on an 88X3310 PHY paired with an mvpp2 MAC configured for
10GBASE-R: wrong MACTYPE mode in config_init.  mv3310_config_init forced
MACTYPE to 10GBASER (XFI/SGMII auto-neg). In auto-neg mode the PHY
switches its host-side serdes to SGMII at 1G link speed, which causes
phylink to invoke mac_prepare/mac_config with a changed interface, which
in turn causes mvpp2 to reinitialise the comphy from 10GBASE-R to SGMII.
Since the 88X3310 always presents a fixed 10GBASE-R (XFI) serdes toward
the MAC, the comphy reconfiguration corrupts the link and RX stays
broken.

Fix: always select RATE_MATCH mode (MACTYPE 6). In this mode the PHY
presents a fixed 10GBASE-R serdes to the MAC and adapts the copper rate
internally, so the MAC/comphy never needs reconfiguring across speed
changes.

Add a copper_multispeed flag to mv3310_mactype so that RATE_MATCH
entries still expose SGMII/2.5G/5G in possible_interfaces, allowing
phylink to validate and announce all copper speeds to user space.
…G-641)

Enchances 262987b
net: phy: marvell10g: fix 10GBASE-R host serdes reset after link cycle (TG-641)
By:
- Adding a 10ms static guard delay after the poll completes, to cover
  the observed gap between bit 15 clearing and PHY readiness.
- Increasing the post-SWRST msleep from 100ms to 200ms to cover the
  observed worst-case SWRST completion time of ~157ms.
@paul-sirin paul-sirin requested a review from adrian-nicolau May 25, 2026 13:14
@paul-sirin
Copy link
Copy Markdown
Author

200ms timeout is close to some timing margin and thus worsening the race

@paul-sirin paul-sirin closed this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant