mbox series

[net-next,v2,0/5] Removing more phylink cruft

Message ID Zw-OCSv7SldjB7iU@shell.armlinux.org.uk (mailing list archive)
Headers show
Series Removing more phylink cruft | expand

Message

Russell King (Oracle) Oct. 16, 2024, 9:57 a.m. UTC
Hi,

Continuing on with the cleanups, this patch series removes
dsa_port_phylink_mac_select_pcs() which is no longer required. This
will have no functional effect as phylink does this:

        bool using_mac_select_pcs = false;

        if (mac_ops->mac_select_pcs &&
            mac_ops->mac_select_pcs(config, PHY_INTERFACE_MODE_NA) !=
              ERR_PTR(-EOPNOTSUPP))
                using_mac_select_pcs = true;

and no mac_select_pcs() method is equivalent to a mac_select_pcs()
that returns -EOPNOTSUPP.

We then make mv88e6xxx_mac_select_pcs() return NULL, as we don't want
to invoke this old behaviour anymore - mv88e6xxx doesn't require it.

Then, allow phylink to remove PCS, which has been a long standing
behavioural oddity.

Remove the use of pl->pcs when validating as this will never be
non-NULL unless "using_mac_select_pcs" was set.

This then clears the way to removing using_mac_select_pcs from phylink
and the check.

 drivers/net/dsa/mv88e6xxx/chip.c |  2 +-
 drivers/net/phy/phylink.c        | 18 +++-----------
 net/dsa/port.c                   |  8 --------
 3 files changed, 5 insertions(+), 23 deletions(-)

Comments

Maxime Chevallier Oct. 16, 2024, 2:42 p.m. UTC | #1
Hi,

On Wed, 16 Oct 2024 10:57:29 +0100
"Russell King (Oracle)" <linux@armlinux.org.uk> wrote:

> Hi,
> 
> Continuing on with the cleanups, this patch series removes
> dsa_port_phylink_mac_select_pcs() which is no longer required. This
> will have no functional effect as phylink does this:
> 
>         bool using_mac_select_pcs = false;
> 
>         if (mac_ops->mac_select_pcs &&
>             mac_ops->mac_select_pcs(config, PHY_INTERFACE_MODE_NA) !=
>               ERR_PTR(-EOPNOTSUPP))
>                 using_mac_select_pcs = true;
> 
> and no mac_select_pcs() method is equivalent to a mac_select_pcs()
> that returns -EOPNOTSUPP.
> 
> We then make mv88e6xxx_mac_select_pcs() return NULL, as we don't want
> to invoke this old behaviour anymore - mv88e6xxx doesn't require it.
> 
> Then, allow phylink to remove PCS, which has been a long standing
> behavioural oddity.
> 
> Remove the use of pl->pcs when validating as this will never be
> non-NULL unless "using_mac_select_pcs" was set.
> 
> This then clears the way to removing using_mac_select_pcs from phylink
> and the check.

I don't have any setup with such a switch or that could trigger the
PCS removal, so I couldn't fully test it. However it does look good to
me :)

For the series,

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime
patchwork-bot+netdevbpf@kernel.org Oct. 18, 2024, 2:30 a.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (main)
by Andrew Lunn <andrew@lunn.ch>:

On Wed, 16 Oct 2024 10:57:29 +0100 you wrote:
> Hi,
> 
> Continuing on with the cleanups, this patch series removes
> dsa_port_phylink_mac_select_pcs() which is no longer required. This
> will have no functional effect as phylink does this:
> 
>         bool using_mac_select_pcs = false;
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/5] net: dsa: remove dsa_port_phylink_mac_select_pcs()
    https://git.kernel.org/netdev/net-next/c/ecb595ebba0e
  - [net-next,v2,2/5] net: dsa: mv88e6xxx: return NULL when no PCS is present
    https://git.kernel.org/netdev/net-next/c/14ca726ada7f
  - [net-next,v2,3/5] net: phylink: allow mac_select_pcs() to remove a PCS
    https://git.kernel.org/netdev/net-next/c/486dc391ef43
  - [net-next,v2,4/5] net: phylink: remove use of pl->pcs in phylink_validate_mac_and_pcs()
    https://git.kernel.org/netdev/net-next/c/6c48cd044cc8
  - [net-next,v2,5/5] net: phylink: remove "using_mac_select_pcs"
    https://git.kernel.org/netdev/net-next/c/7530ea26c810

You are awesome, thank you!