Skip to content

net: dsa: mxl862xx: wait for internal GPHYs before registering MDIO bus - #211

Merged
frank-w merged 1 commit into
frank-w:7.1-mainfrom
Allie-Leth:pro-mxl862xx-wait-for-phys
Aug 4, 2026
Merged

net: dsa: mxl862xx: wait for internal GPHYs before registering MDIO bus#211
frank-w merged 1 commit into
frank-w:7.1-mainfrom
Allie-Leth:pro-mxl862xx-wait-for-phys

Conversation

@Allie-Leth

Copy link
Copy Markdown

Fixes the intermittent lan1-missing-at-boot race from t/27755: the one-shot mdiobus scan can hit address 0 while that GPHY is still booting its own firmware, and the single failed ID read drops the port until rebind or reboot.

The fix polls every DT-declared PHY for a valid PHYSID1 before of_mdiobus_register(), using a quiet relay read (same idiom as mxl862xx_wait_ready()) so the wait produces no error spam. On timeout it warns and continues, so a genuinely absent PHY behaves as today, minus the silence.

Validated on two BPI-R4 Pro 8x.

The race is distinct from the CMD-1802 flood fixed by #207 - it reproduced on a tree with those fixes applied. Timing numbers are from this board/firmware; the generous timeout is deliberate since the window is firmware-dependent.

After the soft reset the switch reports ready once its management
firmware answers commands, but each internal GPHY keeps booting its
own firmware for a window beyond that, and the relay answers even
ID-register reads with an error until it is done.
of_mdiobus_register() scans the DT children once, and a PHY whose ID
read fails is dropped permanently ("MDIO device at address 0 is
missing"); address 0 is scanned first and intermittently loses the
race, leaving lan1 absent until rebind or reboot.
Poll every DT-declared PHY for a valid PHYSID1 before registering the
bus; warn and continue on timeout. Observed and validated on a
BPI-R4 Pro 8x (switch firmware 1.0.70), where management-ready lands
at ~2.4s and the losing window is tens of ms wide.
Signed-off-by: Allie <allie.leth@gmail.com>
@frank-w
frank-w merged commit f301d68 into frank-w:7.1-mainAug 4, 2026
@dangowrt

Copy link
Copy Markdown
Contributor

Please submit this patch also to the upstream Linux netdev mailing list.

Sign up for freeto 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.

3 participants

@Allie-Leth@dangowrt@frank-w