mbox series

[net-next,00/11] Convert mv88e6xxx to phylink_pcs

Message ID ZK+4tOD4EpFzNM9x@shell.armlinux.org.uk (mailing list archive)
Headers show
Series Convert mv88e6xxx to phylink_pcs | expand

Message

Russell King (Oracle) July 13, 2023, 8:41 a.m. UTC
Hi,

This series (previously posted with further patches on the 26 June as
RFC) converts mv88e6xxx to phylink_pcs, and thus moves it from being
a pre-March 2020 legacy driver.

The first four patches lay the ground-work for the conversion by
adding four new methods to the phylink_pcs operations structure:

  pcs_enable() - called when the PCS is going to start to be used
  pcs_disable() - called when the PCS is no longer being used

  pcs_pre_config() - called before the MAC configuration method
  pcs_post_config() - called after the MAC configuration method
      Both of these are necessary for some of the mv88e639x
      workarounds.

We also add the ability to inform phylink of a change to the PCS
state without involving the MAC later, by providing
phylink_pcs_change() which takes a phylink_pcs structure rather than
a phylink structure. phylink maintains which instance the PCS is
conencted to, so internally it can do the right thing when the PCS
is in-use.

Then we provide some additional mdiobus and mdiodev accessors that
we will be using in the new PCS drivers.

The changes for mv88e6xxx follow, and the first one needs to be
explicitly pointed out - we (Andrew and myself) have both decided that
all possible approaches to maintaining backwards compatibility with DT
have been exhaused - everyone has some objection to everything that
has been proposed. So, after many years of trying, we have decided
that this is just an impossibility, and with this patch, we are now
intentionally and knowingly breaking any DT that does not specify the
CPU and DSA port fixed-link parameters. Hence why Andrew has recently
been submitting DT update patches. It is regrettable that it has come
to this.

Following this, we start preparing 88e6xxx for phylink_pcs conversion
by padding the mac_select_pcs() DSA method, and the internal hooks to
create and tear-down PCS instances. Rather than bloat the already very
large mv88e6xxx_ops structure, I decided that it would be better that
the new internal chip specific PCS methods are all grouped within their
own structure - and this structure can be declared in the PCS drivers
themselves.

Then we have the actual conversion patches, one for each family of PCS.

Lastly, we clean up the driver after conversion, removing all the now
redundant code.

 drivers/net/dsa/mv88e6xxx/Makefile   |    3 +
 drivers/net/dsa/mv88e6xxx/chip.c     |  428 ++-----------
 drivers/net/dsa/mv88e6xxx/chip.h     |   33 +-
 drivers/net/dsa/mv88e6xxx/pcs-6185.c |  190 ++++++
 drivers/net/dsa/mv88e6xxx/pcs-6352.c |  390 ++++++++++++
 drivers/net/dsa/mv88e6xxx/pcs-639x.c |  898 +++++++++++++++++++++++++++
 drivers/net/dsa/mv88e6xxx/port.c     |   30 -
 drivers/net/dsa/mv88e6xxx/serdes.c   | 1106 +---------------------------------
 drivers/net/dsa/mv88e6xxx/serdes.h   |  108 +---
 drivers/net/phy/mdio_bus.c           |   24 +-
 drivers/net/phy/phylink.c            |  110 +++-
 include/linux/mdio.h                 |   26 +
 include/linux/phylink.h              |   29 +
 13 files changed, 1737 insertions(+), 1638 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org July 14, 2023, 8 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 13 Jul 2023 09:41:24 +0100 you wrote:
> Hi,
> 
> This series (previously posted with further patches on the 26 June as
> RFC) converts mv88e6xxx to phylink_pcs, and thus moves it from being
> a pre-March 2020 legacy driver.
> 
> The first four patches lay the ground-work for the conversion by
> adding four new methods to the phylink_pcs operations structure:
> 
> [...]

Here is the summary with links:
  - [net-next,01/11] net: phylink: add pcs_enable()/pcs_disable() methods
    https://git.kernel.org/netdev/net-next/c/90ef0a7b0622
  - [net-next,02/11] net: phylink: add pcs_pre_config()/pcs_post_config() methods
    https://git.kernel.org/netdev/net-next/c/aee6098822ed
  - [net-next,03/11] net: phylink: add support for PCS link change notifications
    https://git.kernel.org/netdev/net-next/c/24699cc1ff3e
  - [net-next,04/11] net: mdio: add unlocked mdiobus and mdiodev bus accessors
    https://git.kernel.org/netdev/net-next/c/e6a45700e7e1
  - [net-next,05/11] net: dsa: mv88e6xxx: remove handling for DSA and CPU ports
    https://git.kernel.org/netdev/net-next/c/40da0c32c3fc
  - [net-next,06/11] net: dsa: mv88e6xxx: add infrastructure for phylink_pcs
    https://git.kernel.org/netdev/net-next/c/b92143d4420f
  - [net-next,07/11] net: dsa: mv88e6xxx: export mv88e6xxx_pcs_decode_state()
    https://git.kernel.org/netdev/net-next/c/05407b0ebc39
  - [net-next,08/11] net: dsa: mv88e6xxx: convert 88e6185 to phylink_pcs
    https://git.kernel.org/netdev/net-next/c/4aabe35c385c
  - [net-next,09/11] net: dsa: mv88e6xxx: convert 88e6352 to phylink_pcs
    https://git.kernel.org/netdev/net-next/c/85764555442f
  - [net-next,10/11] net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs
    https://git.kernel.org/netdev/net-next/c/e5b732a275f5
  - [net-next,11/11] net: dsa: mv88e6xxx: cleanup after phylink_pcs conversion
    https://git.kernel.org/netdev/net-next/c/d20acfdd3f88

You are awesome, thank you!