Re: [PATCH net-next v5 2/5] net: dsa: mxl862xx: add SMDIO clause-22 register access

From: Andrew Lunn

Date: Thu Jul 30 2026 - 17:11:43 EST


On Sat, Jul 25, 2026 at 03:16:03AM +0100, Daniel Golle wrote:
> Add mxl862xx_smdio_read() and mxl862xx_smdio_write() for clause-22
> SMDIO register access. The switch's MCUboot bootloader exposes only
> clause-22 registers; the clause-45 MMD interface needs the running
> firmware and is unavailable while the switch is in MCUboot. The MDIO
> bus lock is held per-transaction (not across polls) so that SB PDI
> polling during flash erase does not starve other non-switch users of
> the same MDIO bus, such as separate PHYs providing WAN or management
> interfaces.
>
> Unlike mxl862xx_api_wrap(), which takes the bus lock with
> MDIO_MUTEX_NESTED because it can be entered from the accessors of
> the switch-internal MDIO bus while that bus's lock of the same lock
> class is already held, the SMDIO helpers take it with a plain
> mutex_lock(). They are only called from probe and devlink flash
> contexts where no other MDIO bus lock can be held.
>
> Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew