Subject: Re: [PATCH RFC net-next 11/12] net: dsa: sja1105: convert to phylink_generic_validate()

From: "Russell King (Oracle)" <[email-masked]>
Date: Wed, 24 Nov 2021 23:21:35 +0000

On Wed, Nov 24, 2021 at 10:34:33PM +0000, Vladimir Oltean wrote:
> On Wed, Nov 24, 2021 at 09:08:33PM +0000, Russell King (Oracle) wrote:
> > On Wed, Nov 24, 2021 at 07:53:40PM +0000, Vladimir Oltean wrote:
> > > On Wed, Nov 24, 2021 at 05:53:19PM +0000, Russell King (Oracle) wrote:
> > > > Populate the supported interfaces and MAC capabilities for the SJA1105
> > > > DSA switch and remove the old validate implementation to allow DSA to
> > > > use phylink_generic_validate() for this switch driver.
> > > > 
> > > > This switch only supports a static model of configuration, so we
> > > > restrict the interface modes to the configured setting, and pass the
> > > > MAC capabilities. As it is unclear which interface modes support 1G
> > > > speeds, we keep the setting of MAC_1000FD conditional on the configured
> > > > interface mode.
> > > > 
> > > > Signed-off-by: Russell King (Oracle) <[email-masked]>
> > > > ---
> > > 
> > > Please use this patch for sja1105. Thanks.
> > 
> > Your patch is combining two changes into one patch. Specifically, the
> > there are two logical changes in your patch:
> > 
> > 1) changing the existing behaviour of the validate() function by
> > allowing switching between PHY_INTERFACE_MODE_SGMII and
> > PHY_INTERFACE_MODE_2500BASEX, which was not permitted before with the
> > sja1105_phy_mode_mismatch() check.
> > 
> > 2) converting to supported_interfaces / mac_capabilities way of defining
> > what is supported.
> > 
> > Combining the two changes makes the patch harder to review, and it
> > becomes less obvious that it is actually correct. I would recommend
> > changing the existing behaviour prior to the conversion, but ultimately
> > that is your decision.
> > 
> > For more information please see the "Separate your changes" section in
> > Documentation/process/submitting-patches.rst
> > 
> > Thanks.
> 
> -- >8 --
> From febedc56cf0e269556e7483a70a3e6cb8d0d5cc3 Mon Sep 17 00:00:00 2001
> From: Vladimir Oltean <[email-masked]>
> Date: Wed, 24 Nov 2021 21:02:43 +0200
> Subject: [PATCH] net: dsa: sja1105: convert to phylink_generic_validate()
> 
> Provide a ->phylink_get_caps() implementation in order to tell phylink
> what are the PHY modes between which each port can change (none for
> now), and the MAC capabilities so it can limit the advertisement and
> supported masks of the PHY.
> 
> Now that we populate phylink_config->supported_interfaces, it is
> phylink's responsibility to not attempt a PHY mode change towards
> something which we do not support, so we can delete the logic from
> sja1105_phy_mode_mismatch() and move the essence of it into
> sja1105_phylink_get_caps(), which happens much earlier.
> 
> This patch also fixes an inconsequential bug, which was that for ports
> which support 2500base-X, we used to keep advertising the gigabit and
> lower speeds. We should not have done this, because 2500base-X operates
> only at 2500Mbps (and we do not support PAUSE frames in order for the
> lower media speeds to work via rate adaptation). Nonetheless, the only
> SJA1110 boards which use 2500base-X use it in a SERDES-to-SERDES fixed
> link, so there isn't any PHY whose advertisement matters there.
> 
> Signed-off-by: Vladimir Oltean <[email-masked]>

Clearly, you have stopped listening to me. This can no longer be
productive.

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