netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/5] net: phylink: introduce legacy mode flag
@ 2021-12-07 15:51 Russell King (Oracle)
  2021-12-09 13:11 ` [PATCH net-next 1/5] net: phylink: add legacy_pre_march2020 indicator Russell King (Oracle)
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Russell King (Oracle) @ 2021-12-07 15:51 UTC (permalink / raw)
  To: Chris Snook, Felix Fietkau, Florian Fainelli, John Crispin,
	Mark Lee, Matthias Brugger, Sean Wang, Vivien Didelot,
	Vladimir Oltean
  Cc: Andrew Lunn, David S. Miller, Heiner Kallweit, Jakub Kicinski,
	linux-arm-kernel, linux-mediatek, netdev

Hi all,

In March 2020, phylink gained support to split the PCS support out of
the MAC callbacks. By doing so, a slight behavioural difference was
introduced when a PCS is present, specifically:

1) the call to mac_config() when the link comes up or advertisement
   changes were eliminated
2) mac_an_restart() will never be called
3) mac_pcs_get_state() will never be called

The intention was to eventually remove this support once all phylink
users were converted. Unfortunately, this still hasn't happened - and
in some cases, it looks like it may never happen.

Through discussion with Sean Anderson, we now need to allow the PCS to
be optional for modern drivers, so we need a different way to identify
these legacy drivers - in that we wish to allow the "modern" behaviour
where mac_config() is not called on link-up events, even if there is
no PCS attached.

In order to do that, this series of patches introduce a
"legacy_pre_march2020" which is used to permit the old behaviour - in
other words, we get the old behaviour only when there is no PCS and
this flag is true. Otherwise, we get the new behaviour.

I decided to use the date of the change in the flag as just using
"legacy" or "legacy_driver" is too non-descript. An alternative could
be to use the git sha1 hash of the set of changes.

I believe I have added the legacy flag to all the drivers which use
legacy mode - that being the mtk_eth_soc ethernet driver, and many DSA
drivers - the ones which need the old behaviour are identified by
having non-NULL phylink_mac_link_state or phylink_mac_an_restart
methods in their dsa_switch_ops structure.

ag71xx and xilinx do not need the legacy flag. ag71xx is explained in
its own commit, and xilinx only updates the inband advertisement in
the mac_config() call, which is sufficient qualification to avoid it
being marked legacy.

 drivers/net/ethernet/atheros/ag71xx.c       | 13 -------------
 drivers/net/ethernet/mediatek/mtk_eth_soc.c |  4 ++++
 drivers/net/phy/phylink.c                   | 12 ++++++------
 include/linux/phylink.h                     | 20 ++++++++++++++++++++
 net/dsa/port.c                              |  7 +++++++
 5 files changed, 37 insertions(+), 19 deletions(-)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-09 20:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-07 15:51 [PATCH net-next 0/5] net: phylink: introduce legacy mode flag Russell King (Oracle)
2021-12-09 13:11 ` [PATCH net-next 1/5] net: phylink: add legacy_pre_march2020 indicator Russell King (Oracle)
2021-12-09 13:11 ` [PATCH net-next 2/5] net: dsa: mark DSA phylink as legacy_pre_march2020 Russell King (Oracle)
2021-12-09 13:11 ` [PATCH net-next 3/5] net: mtk_eth_soc: mark as a legacy_pre_march2020 driver Russell King (Oracle)
2021-12-09 13:11 ` [PATCH net-next 4/5] net: phylink: use legacy_pre_march2020 Russell King (Oracle)
2021-12-09 13:11 ` [PATCH net-next 5/5] net: ag71xx: remove unnecessary legacy methods Russell King (Oracle)
2021-12-09 20:00 ` [PATCH net-next 0/5] net: phylink: introduce legacy mode flag patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).