Subject: Re: [PATCH net-next 0/10] net: dsa: improve serdes integration

From: Russell King - ARM Linux admin <[email-masked]>
Date: Fri, 6 Mar 2020 10:39:34 +0000

On Fri, Mar 06, 2020 at 04:57:20AM +0100, Andrew Lunn wrote:
> Hi Russell
> 
> > I will try to figure out which patch broke it.
> 
> ommit e67b45adefa8d43c68560906f3955845a5ee14d8 (HEAD)
> Author: Russell King <[email-masked]>
> Date:   Thu Mar 5 12:42:26 2020 +0000
> 
>     net: dsa: mv88e6xxx: configure interface settings in mac_config
>     
>     Only configure the interface settings in mac_config(), leaving the
>     speed and duplex settings to mac_link_up to deal with.
> 
> Maybe:
> 
> 
> +       /* FIXME: should we force the link down here - but if we do, how
> +        * do we restore the link force/unforce state? The driver layering
> +        * gets in the way.
> +        */
> 
> ???

That's a possibility.  Is the MAC already configured for the interface
mode though?

The problem occurs because the CPU and DSA ports are forced up during
DSA initialisation, but phylink expects the link to initially be down.
So, one may think that simply forcing the link down here to work around
that would be a solution.

Unfortunately, that means that CPU and DSA ports without a fixed-link
spec will stay down because phylink won't call mac_link_up() - so we're
back to the poor integration of phylink for CPU and DSA ports problem.
Even if phylink /were/ to call mac_link_up() for that situation,
phylink has no information on the speed and duplex for such a port, so
speed and duplex would be nonsense.

That conversion is very problematical.

I do have some patches that solve it by changing phylink, but it's
quite a hack - the problem is detecting the uninitialised state in
phylink_start(), which is really quite late.  You can find them in my
"zii" branch:

net: dsa: mv88e6xxx: split out SPEED_MAX setting
net: phylink/dsa: fix DSA and CPU links

So, I think we're back to... what do we do about the broken phylink
integration for CPU and DSA ports.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up