net: dsa: mxl862xx: wait for internal GPHYs before registering MDIO bus - #211
Merged
Merged
Conversation
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>dangowrt
commented
Aug 10, 2026
Contributor
Please submit this patch also to the upstream Linux netdev mailing list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asmxl862xx_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.