lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 22 Dec 2023 20:04:27 +0300
From: Arınç ÜNAL <arinc.unal@...nc9.com>
To: Alvin Šipraga <ALSI@...g-olufsen.dk>,
 Vladimir Oltean <olteanv@...il.com>
Cc: 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 22.12.2023 14:13, Alvin Šipraga wrote:
> 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.

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.

Arınç

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ