[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJq09z4LKwkumhR2CiLzczoFM1Ut-yAr9zHZLypopes8t_nrew@mail.gmail.com>
Date: Fri, 22 Dec 2023 17:28:24 -0300
From: Luiz Angelo Daros de Luca <luizluca@...il.com>
To: Arınç ÜNAL <arinc.unal@...nc9.com>
Cc: Alvin Šipraga <ALSI@...g-olufsen.dk>,
Vladimir Oltean <olteanv@...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
> >>>> 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.
>
> I was speaking in the sense of all switches with CPU ports, which is
> controlled by the DSA subsystem on Linux.
>
> I am only stating the fact that if we don't take the literal approach with
> hardware descriptions on the driver implementation, there will always be
> cases where the drivers will fail to support certain hardware designs.
Hi Arinç,
The old code was already requiring a single switch child node
describing the internal MDIO bus akin to binding docs. I believe what
we use to match it, being the name or the compatible string property,
wouldn't improve the diversity of HW we could support. This series
doesn't want to solve all issues and limitations nor prepare the
ground for different HWs. It's mostly a reorganization without nice
new stuff.
After this series, we could easily turn the mdio node optional,
skipping the MDIO bus when not found. Anyway, if such HW appears just
now, I believe we could simply workaround it by declaring an empty
mdio node.
Regards,
Luiz
Powered by blists - more mailing lists