[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c639c62-cc07-4b3d-a18b-77f93668b88f@kwiboo.se>
Date: Mon, 28 Jul 2025 17:24:27 +0200
From: Jonas Karlman <jonas@...boo.se>
To: Andrew Lunn <andrew@...n.ch>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Alvin Šipraga <alsi@...g-olufsen.dk>,
Vladimir Oltean <olteanv@...il.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Yao Zi <ziyao@...root.org>, Chukun Pan <amadeus@....edu.cn>,
Heiko Stuebner <heiko@...ech.de>, netdev@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 2/3] net: dsa: realtek: Add support for use of an
optional mdio node
Hi Andrew,
On 7/28/2025 12:09 AM, Andrew Lunn wrote:
>> Something like above does not seem to work, I get following:
>>
>> mdio_bus stmmac-0: MDIO device at address 0 is missing.
>> mdio_bus stmmac-0: MDIO device at address 1 is missing.
>> mdio_bus stmmac-0: MDIO device at address 2 is missing.
>> mdio_bus stmmac-0: MDIO device at address 3 is missing.
>
> O.K, So i was wrong.
>
>> And without an explicit 'mdio' child node the driver currently fails to
>> load and the switch is never registered:
>>
>> rtl8365mb-mdio stmmac-0:1d: found an RTL8367RB-VB switch
>> rtl8365mb-mdio stmmac-0:1d: no MDIO bus node
>> rtl8365mb-mdio stmmac-0:1d: could not set up MDIO bus
>> rtl8365mb-mdio stmmac-0:1d: error -ENODEV: unable to register switch
>
> So, not having an MDIO node was a long time ago seen as a short cut
> for when there was a clear 1:1 mapping between port number and PHY bus
> address. It still works, but it is somewhat deprecated. It also seems
> like it is become more normal to need additional properties, like what
> interrupt the PHY is using, the LEDs it has, etc.
Sure, no problem to change to a more verbose DT even when there is a
clear 1:1 mapping between port, phy and interrupt here.
When it comes to having the switch being described as an interrupt
controller in the DT is also very wrong, the switch only consume a
single HW interrupt. The fact that the driver creates virtual irq for
each port is purely a software construct and is not something that
should be reflected in the DT.
Possible something for a future series to clean up.
>
>>
>> With a 'mdio' child node 'make CHECK_DTBS=y' report something like:
>>
>> rockchip/rk3528-radxa-e24c.dtb: ethernet-switch@1d (realtek,rtl8365mb): mdio: False schema does not allow { [snip] }
>> from schema $id: http://devicetree.org/schemas/net/dsa/realtek.yaml#
>>
>> So something should probably be changed, the driver, dt-bindings or
>> possible both.
>
> I think you should allow an MDIO node in DT. This is the only DSA
> driver that i know of which does not allow it.
Sure, I will drop this driver change and instead update the dt-binding
to allow use of a mdio node when the reg prop is defined.
Regards,
Jonas
>
> Andrew
Powered by blists - more mailing lists