Re: [PATCH net-next v6 3/3] net: dsa: yt921x: Add support for Motorcomm YT921x
From: Yangfl
Date: Mon Aug 25 2025 - 10:17:09 EST
On Mon, Aug 25, 2025 at 2:14 AM Russell King (Oracle)
<linux@xxxxxxxxxxxxxxx> wrote:
>
> On Mon, Aug 25, 2025 at 12:38:20AM +0800, Yangfl wrote:
> > They are used in phylink_get_caps(), since I don't want to declare a
> > port which we know it does not exist on some chips. But the info_* set
> > might be inlined and removed since it is not used elsewhere.
>
> The problem is... if you have a port in 0..N that DSA thinks should be
> used, but is neither internal or external, DSA's initialisation of it
> will fail, because without any caps declared for it, phylink_create()
> will return an error, causing dsa_port_phylink_create() to fail,
> dsa_shared_port_phylink_register() or dsa_user_phy_setup(),
> dsa_shared_port_link_register_of() or dsa_user_create()... etc. It
> eventually gets propagated up causing the entire switch probe to fail.
>
> Again... read the code!
What would you expect when you specify Port 0 in DT when only Port 1,
3, 8 are available on the chip (YT9213NB)? Probe error.