mbox series

[net-next,0/4] net: dsa: microchip: use phylink_mac_ops for ksz driver

Message ID ZivP/R1IwKEPb5T6@shell.armlinux.org.uk (mailing list archive)
Headers show
Series net: dsa: microchip: use phylink_mac_ops for ksz driver | expand

Message

Russell King (Oracle) April 26, 2024, 4:02 p.m. UTC
Hi,

This four patch series switches the Microchip KSZ DSA driver to use
phylink_mac_ops support, and for this one we go a little further
beyond a simple conversion. This driver has four distinct cases:

lan937x
ksz9477
ksz8
ksz8830

Three of these cases are handled by shimming the existing DSA calls
through ksz_dev_ops, and the final case is handled through a
conditional in ksz_phylink_mac_config(). These can all be handled
with separate phylink_mac_ops.

To get there, we do a progressive conversion.

Patch 1 removes ksz_dev_ops' phylink_mac_config() method which is
not populated in any of the arrays - and is thus redundant.

Patch 2 switches the driver to use a common set of phylink_mac_ops
for all cases, doing the simple conversion to avoid the DSA shim.

Patch 3 pushes the phylink_mac_ops down to the first three classes
(lan937x, ksz9477, ksz8) adding an appropriate pointer to the
phylink_mac_ops to struct ksz_chip_data, and using that to
populate DSA's ds->phylink_mac_ops pointer. The difference between
each of these are the mac_link_up() method. mac_config() and
mac_link_down() remain common between each at this stage.

Patch 4 splits out ksz8830, which needs different mac_config()
handling, and thus means we have a difference in mac_config()
methods between the now four phylink_mac_ops structures.

Build tested only, with additional -Wunused-const-variable flag.

 drivers/net/dsa/microchip/ksz8.h       |   6 +-
 drivers/net/dsa/microchip/ksz8795.c    |  10 ++-
 drivers/net/dsa/microchip/ksz_common.c | 121 ++++++++++++++++++++++-----------
 drivers/net/dsa/microchip/ksz_common.h |   5 +-
 4 files changed, 94 insertions(+), 48 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org April 30, 2024, 2:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 26 Apr 2024 17:02:05 +0100 you wrote:
> Hi,
> 
> This four patch series switches the Microchip KSZ DSA driver to use
> phylink_mac_ops support, and for this one we go a little further
> beyond a simple conversion. This driver has four distinct cases:
> 
> lan937x
> ksz9477
> ksz8
> ksz8830
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] net: dsa: ksz_common: remove phylink_mac_config from ksz_dev_ops
    https://git.kernel.org/netdev/net-next/c/8433c5833ed9
  - [net-next,2/4] net: dsa: ksz_common: provide own phylink MAC operations
    https://git.kernel.org/netdev/net-next/c/95fe2662c56f
  - [net-next,3/4] net: dsa: ksz_common: sub-driver phylink ops
    https://git.kernel.org/netdev/net-next/c/9424c0731355
  - [net-next,4/4] net: dsa: ksz_common: use separate phylink_mac_ops for ksz8830
    https://git.kernel.org/netdev/net-next/c/968d068e5476

You are awesome, thank you!