You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net: dsa: mxl862xx: wait for firmware boot-time configuration to finish
The switch firmware answers MDIO API commands long before its
application thread has finished applying the built-in boot-time
default configuration. The management interface is brought up as
part of the firmware's device initialization, while the application
thread afterwards reconfigures bridge ports 0..16, meters, WRED
thresholds, PCE rules and VLAN resources, and only then enables
ingress SDMA on all ports as the very last step of its default
configuration.
mxl862xx_wait_ready() declares the switch ready as soon as
FW_VERSION and CFGGET succeed, typically ~2.4s after reset. All
configuration issued by the driver between that point and the
firmware's final SDMA enable races the firmware's own writes and may
be silently overwritten. Depending on boot timing this can leave the
switch in a state where every frame received from the conduit is
dropped by the ingress filter (RxFilteredPkts on the CPU port
increments in lockstep with conduit TX) while the reverse direction
keeps working. The state persists until the race is re-run with
better luck. Observed on a MxL86252C in roughly half of the boots
of a BananaPi BPI-R4 Pro 8X board [1].
Gate readiness on the firmware's final configuration step instead:
poll the SDMA port control register of logical port 0 via the
RegisterGet API until the port enable bit is set. The reset issued
right before waiting clears that bit on all ports, and the driver
does not touch any port state until after mxl862xx_wait_ready() has
returned, so within this window the bit can only have been set by
the firmware application completing its boot-time configuration.
Logical port 0 is the switch-internal CPU port which the driver
itself never enables.
[1] openwrt/openwrt#24642 (comment)
Fixes: 23794be ("net: dsa: add basic initial driver for MxL862xx switches")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
0 commit comments