Re: [PATCH net-next v2 4/4] net: dsa: soce: Add basic support for SoC-e switch IP cores
From: Andrew Lunn
Date: Tue Sep 08 2026 - 15:23:49 EST
> > What is the MDIO master?
>
> It refers to the switch-integrated MDIO controller: one shared set of
> MMIO transaction registers serving multiple selectable MDIO buses. The
> switch documentation calls it an MDIO bridge. I will rename "master" to
> "controller".
In Linux, we have the concept of MDIO muxes. You have one true MDIO
bus master, and then logic gates to connect it to many MDIO
busses. Generally, the MDIO data line has a set of analogue switches
to mux it to one of the many MDIO busses.
Having only one true MDIO bus master means you cannot do transactions
in parallel.
It seems like this is how this hardware works. The question is, should
we model it this way. Take a look at mdio-mux-mmioreg.c. Maybe the
MDIO bus driver can be placed into drivers/net/mdio, and a
mdio-mux-mmioreg stacked on top of it to provide the per port MDIO
busses. That will make the locking simpler, and remove a lot of code.
Andrew