mbox series

[net-next,00/10] net: pcs: xpcs: cleanups batch 1

Message ID ZvwdKIp3oYSenGdH@shell.armlinux.org.uk (mailing list archive)
Headers show
Series net: pcs: xpcs: cleanups batch 1 | expand

Message

Russell King (Oracle) Oct. 1, 2024, 4:02 p.m. UTC
Hi,

First, sorry for the bland series subject - this is the first in a
number of cleanup series to the XPCS driver. This series has some
functional changes beyond merely cleanups, notably the first patch.

This series starts off with a patch that moves the PCS reset from
the xpcs_create*() family of calls to when phylink first configures
the PHY. The motivation for this change is to get rid of the
interface argument to the xpcs_create*() functions, which I see as
unnecessary complexity. This patch should be tested on Wangxun
and STMMAC drivers.

Patch 2 removes the now unnecessary interface argument from the
internal xpcs_create() and xpcs_init_iface() functions. With this,
xpcs_init_iface() becomes a misnamed function, but patch 3 removes
this function, moving its now meager contents to xpcs_create().

Patch 4 adds xpcs_destroy_pcs() and xpcs_create_pcs_mdiodev()
functions which return and take a phylink_pcs, allowing SJA1105
and Wangxun drivers to be converted to using the phylink_pcs
structure internally.

Patches 5 through 8 convert both these drivers to that end.

Patch 9 drops the interface argument from the remaining xpcs_create*()
functions, addressing the only remaining caller of these functions,
that being the STMMAC driver.

As patch 7 removed the direct calls to the XPCS config/link-up
functions, the last patch makes these functions static.

 drivers/net/dsa/sja1105/sja1105.h                 |  2 +-
 drivers/net/dsa/sja1105/sja1105_main.c            | 85 ++++++++++----------
 drivers/net/dsa/sja1105/sja1105_mdio.c            | 28 ++++---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c |  7 +-
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c    | 18 ++---
 drivers/net/ethernet/wangxun/txgbe/txgbe_type.h   |  2 +-
 drivers/net/pcs/pcs-xpcs.c                        | 92 ++++++++++++++---------
 include/linux/pcs/pcs-xpcs.h                      | 14 ++--
 8 files changed, 132 insertions(+), 116 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 3, 2024, 12:40 a.m. UTC | #1
Hello:

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

On Tue, 1 Oct 2024 17:02:48 +0100 you wrote:
> Hi,
> 
> First, sorry for the bland series subject - this is the first in a
> number of cleanup series to the XPCS driver. This series has some
> functional changes beyond merely cleanups, notably the first patch.
> 
> This series starts off with a patch that moves the PCS reset from
> the xpcs_create*() family of calls to when phylink first configures
> the PHY. The motivation for this change is to get rid of the
> interface argument to the xpcs_create*() functions, which I see as
> unnecessary complexity. This patch should be tested on Wangxun
> and STMMAC drivers.
> 
> [...]

Here is the summary with links:
  - [net-next,01/10] net: pcs: xpcs: move PCS reset to .pcs_pre_config()
    https://git.kernel.org/netdev/net-next/c/277b339c4ba5
  - [net-next,02/10] net: pcs: xpcs: drop interface argument from internal functions
    https://git.kernel.org/netdev/net-next/c/92fb8986083a
  - [net-next,03/10] net: pcs: xpcs: get rid of xpcs_init_iface()
    https://git.kernel.org/netdev/net-next/c/a487c9e7cfc4
  - [net-next,04/10] net: pcs: xpcs: add xpcs_destroy_pcs() and xpcs_create_pcs_mdiodev()
    https://git.kernel.org/netdev/net-next/c/bedea1539acb
  - [net-next,05/10] net: wangxun: txgbe: use phylink_pcs internally
    https://git.kernel.org/netdev/net-next/c/155c499ffd1d
  - [net-next,06/10] net: dsa: sja1105: simplify static configuration reload
    https://git.kernel.org/netdev/net-next/c/a18891b55703
  - [net-next,07/10] net: dsa: sja1105: call PCS config/link_up via pcs_ops structure
    https://git.kernel.org/netdev/net-next/c/907476c66d73
  - [net-next,08/10] net: dsa: sja1105: use phylink_pcs internally
    https://git.kernel.org/netdev/net-next/c/41bf58314b17
  - [net-next,09/10] net: pcs: xpcs: drop interface argument from xpcs_create*()
    https://git.kernel.org/netdev/net-next/c/bf5a61645bb2
  - [net-next,10/10] net: pcs: xpcs: make xpcs_do_config() and xpcs_link_up() internal
    https://git.kernel.org/netdev/net-next/c/faefc9730d07

You are awesome, thank you!
Serge Semin Oct. 4, 2024, 11:29 p.m. UTC | #2
On Tue, Oct 01, 2024 at 05:02:48PM GMT, Russell King (Oracle) wrote:
> Hi,
> 
> First, sorry for the bland series subject - this is the first in a
> number of cleanup series to the XPCS driver. This series has some
> functional changes beyond merely cleanups, notably the first patch.
> 
> This series starts off with a patch that moves the PCS reset from
> the xpcs_create*() family of calls to when phylink first configures
> the PHY. The motivation for this change is to get rid of the
> interface argument to the xpcs_create*() functions, which I see as
> unnecessary complexity. This patch should be tested on Wangxun
> and STMMAC drivers.
> 
> Patch 2 removes the now unnecessary interface argument from the
> internal xpcs_create() and xpcs_init_iface() functions. With this,
> xpcs_init_iface() becomes a misnamed function, but patch 3 removes
> this function, moving its now meager contents to xpcs_create().
> 
> Patch 4 adds xpcs_destroy_pcs() and xpcs_create_pcs_mdiodev()
> functions which return and take a phylink_pcs, allowing SJA1105
> and Wangxun drivers to be converted to using the phylink_pcs
> structure internally.
> 
> Patches 5 through 8 convert both these drivers to that end.
> 
> Patch 9 drops the interface argument from the remaining xpcs_create*()
> functions, addressing the only remaining caller of these functions,
> that being the STMMAC driver.

Better later than never. Just reached my hardware treasury and managed to
test the series out on the next setup:

DW XGMAC <-(XGMII)-> DW XPCS <-(10Gbase-R)-> Marvell 88x2222
<-(10gbase-R)->
SFP+ fiber SFP+
<-(10gbase-r)->
Marvell 88x2222 <-(10gbase-r)-> DW XPCS <-(XGMII)-> DW XGMAC

DW XGMAC was working under the STMMAC driver control.

No problem has been spotted. So

Tested-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

> 
> As patch 7 removed the direct calls to the XPCS config/link-up
> functions, the last patch makes these functions static.
> 
>  drivers/net/dsa/sja1105/sja1105.h                 |  2 +-
>  drivers/net/dsa/sja1105/sja1105_main.c            | 85 ++++++++++----------
>  drivers/net/dsa/sja1105/sja1105_mdio.c            | 28 ++++---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c |  7 +-
>  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c    | 18 ++---
>  drivers/net/ethernet/wangxun/txgbe/txgbe_type.h   |  2 +-
>  drivers/net/pcs/pcs-xpcs.c                        | 92 ++++++++++++++---------
>  include/linux/pcs/pcs-xpcs.h                      | 14 ++--
>  8 files changed, 132 insertions(+), 116 deletions(-)
> 
> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
>