[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hs5nbkipaunm75s3yyoa2it3omumxotyzdudyzrzxeqopmnwal@z5zpbrxwfsqi>
Date: Fri, 22 Dec 2023 11:13:12 +0000
From: Alvin Šipraga <ALSI@...g-olufsen.dk>
To: Vladimir Oltean <olteanv@...il.com>
CC: Arınç ÜNAL <arinc.unal@...nc9.com>, Luiz Angelo
Daros de Luca <luizluca@...il.com>, "linus.walleij@...aro.org"
<linus.walleij@...aro.org>, "andrew@...n.ch" <andrew@...n.ch>,
"f.fainelli@...il.com" <f.fainelli@...il.com>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 5/7] net: dsa: realtek: Migrate user_mii_bus
setup to realtek-dsa
On Fri, Dec 22, 2023 at 12:48:31PM +0200, Vladimir Oltean wrote:
> On Thu, Dec 21, 2023 at 09:34:52PM +0300, Arınç ÜNAL wrote:
> > On 21.12.2023 20:47, Vladimir Oltean wrote:
> > > ds->user_mii_bus helps when
> > > (1) the switch probes with platform_data (not on OF), or
> > > (2) the switch probes on OF but its MDIO bus is not described in OF
> > >
> > > Case (2) is also eliminated because realtek_smi_setup_mdio() bails out
> > > if it cannot find the "mdio" node described in OF. So the ds->user_mii_bus
> > > assignment is only ever executed when the bus has an OF node, aka when
> > > it is not useful.
> >
> > I don't like the fact that the driver bails out if it doesn't find the
> > "mdio" child node. This basically forces the hardware design to use the
> > MDIO bus of the switch. Hardware designs which don't use the MDIO bus of
> > the switch are perfectly valid.
> >
> > It looks to me that, to make all types of hardware designs work, we must
> > not use ds->user_mii_bus for switch probes on OF. Case (2) is one of the
> > cases of the ethernet controller lacking link definitions in OF so we
> > should enforce link definitions on ethernet controllers. This way, we make
> > sure all types of hardware designs work and are described in OF properly.
> >
> > Arınç
>
> The bindings for the realtek switches can be extended in compatible ways,
> e.g. by making the 'mdio' node optional. If we want that to mean "there
> is no internal PHY that needs to be used", there is no better time than
> now to drop the driver's linkage to ds->user_mii_bus, while its bindings
> still strictly require an 'mdio' node.
>
> If we don't drop that linkage _before_ making 'mdio' optional, there
> is no way to disprove the existence of device trees which lack a link
> description on user ports (which is now possible).
I strongly agree and I think that the direction you have suggested is
crystal clear, Vladimir. Nothing prohibits us from relaxing the bindings
later on to support whatever hardware Arınç is describing.
But for my own understanding - and maybe this is more a question for
Arınç since he brought it up up - what does this supposed hardware look
like, where the internal MDIO bus is not used? Here are my two (probably
wrong?) guesses:
(1) you use the MDIO bus of the parent Ethernet controller and access
the internal PHYs directly, hence the internal MDIO bus goes unused;
(2) none of the internal PHYs are actually used, so only the so-called
extension ports are available.
I don't know if (1) really qualifies. And (2) is also a bit strange,
because this family of switches has variants with up to only three
extension ports, most often two, which doesn't make for much of a
switch.
So while I agree in theory with your remark Arınç, I'm just wondering if
you had something specific in mind.
Kind regards,
Alvin
Powered by blists - more mailing lists