Re: [PATCH net-next v2] net: dsa: motorcomm: Resync SMI slave before register access

From: Andrew Lunn

Date: Mon Nov 16 2026 - 21:10:27 EST


On Tue, Nov 17, 2026 at 12:23:00AM +0800, David Yang wrote:
> A register access over MDIO is 4 frames: 2 address writes followed by
> 2 data reads or writes. The SMI slave tracks the phase in a state
> machine, so an access interrupted between frames, e.g. on an MDIO bus
> error, leaves the machine in an unknown state, and every following
> access fails or acts on a stale address until the machine is realigned.
>
> The driver has so far assumed every access succeeds, and relied on
> manual resetting when the state machine wedged. However, without a
> dedicated reset line, the reset itself goes through the same SMI
> interface, causing a chicken-and-egg problem.
>
> Realign the machine once at reset, before the first register access.
>
> Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew