Re: [PATCH netnext 8/8] net: dsa: mt7530: simplify link operations and force link down on all ports

From: Russell King (Oracle)
Date: Fri Feb 16 2024 - 10:44:11 EST


On Thu, Feb 08, 2024 at 08:51:36AM +0300, Arınç ÜNAL via B4 Relay wrote:
> From: Arınç ÜNAL <arinc.unal@xxxxxxxxxx>
>
> Currently, the link operations for switch MACs are scattered across
> port_enable, port_disable, phylink_mac_config, phylink_mac_link_up, and
> phylink_mac_link_down.
>
> port_enable and port_disable clears the link settings. Move that to
> mt7530_setup() and mt7531_setup_common() which set up the switches. This
> way, the link settings are cleared on all ports at setup, and then only
> once with phylink_mac_link_down() when a link goes down.
>
> Enable force mode at setup to apply the force part of the link settings.
> This ensures that only active ports will have their link up.

I think we may have a different interpretation of what phylink's
mac_link_down() and mac_link_up() are supposed to be doing here.
Of course, you have read the documentation of these methods so are
fully aware of what they're supposed to do. So you are aware that
when inband mode is being used, forcing the link down may be
counter-productive depending on how the hardware works.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!