mbox series

[net-next,v2,00/11] complete Lynx mdio device handling

Message ID ZIBwuw+IuGQo5yV8@shell.armlinux.org.uk (mailing list archive)
Headers show
Series complete Lynx mdio device handling | expand

Message

Russell King (Oracle) June 7, 2023, 11:57 a.m. UTC
Hi,

This series completes the mdio device lifetime handling for Lynx PCS
users which do not create their own mdio device, but instead fetch
it using a firmware description - namely the DPAA2 and FMAN_MEMAC
drivers.

In a previous patch set, lynx_pcs_create() was modified to increase
the mdio device refcount, and lynx_pcs_destroy() to drop that
refcount.

The first two patches change these two drivers to put the reference
which they hold immediately after lynx_pcs_create(), effectively
handing the responsibility for maintaining the refcount to the Lynx
PCS driver.

A side effect of the first two patches is that lynx_get_mdio_device()
is no longer used, so patch 3 removes it.

Patch 4 adds a new helper - lynx_pcs_create_fwnode(), which creates
a Lynx PCS instance from the fwnode.

Patch 5 and 6 convert the two drivers to make use of this new helper,
which simply has to find the mdio device, and then create the Lynx
PCS from that.

With those conversions done, lynx_pcs_create() is no longer required
outside pcs-lynx.c, so remove it from public view.

Patch 8 we changes lynx_pcs_create() to return an error-pointer rather
than NULL to bring consistency to the return style, and means that we
can remove the NULL-to-error-pointer conversion from both
lynx_pcs_create_fwnode() and lynx_pcs_create_mdiodev().

Patch 9 adds a check for the fwnode being available, and returns an
-ENODEV error pointer if unavailable.

Patch 10 removes this check from DPAA2, detecting the error pointer
value to continue printing the helpful message.

Patch 11 removes this check from fman_memac, and in doing so fixes a
bug where if the node is unavailable, the reference count is not
dropped.

 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 32 +++++++-------
 drivers/net/ethernet/freescale/fman/fman_memac.c | 18 ++------
 drivers/net/pcs/pcs-lynx.c                       | 54 +++++++++++++++++-------
 include/linux/pcs-lynx.h                         |  4 +-
 4 files changed, 58 insertions(+), 50 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 9, 2023, 2:30 a.m. UTC | #1
Hello:

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

On Wed, 7 Jun 2023 12:57:47 +0100 you wrote:
> Hi,
> 
> This series completes the mdio device lifetime handling for Lynx PCS
> users which do not create their own mdio device, but instead fetch
> it using a firmware description - namely the DPAA2 and FMAN_MEMAC
> drivers.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,01/11] net: dpaa2-mac: allow lynx PCS to manage mdiodev lifetime
    https://git.kernel.org/netdev/net-next/c/6c79a9c8b1f3
  - [net-next,v2,02/11] net: fman_memac: allow lynx PCS to handle mdiodev lifetime
    https://git.kernel.org/netdev/net-next/c/d7b6ea1a14e4
  - [net-next,v2,03/11] net: pcs: lynx: remove lynx_get_mdio_device()
    https://git.kernel.org/netdev/net-next/c/b3b984dc0ba6
  - [net-next,v2,04/11] net: pcs: lynx: add lynx_pcs_create_fwnode()
    https://git.kernel.org/netdev/net-next/c/6e1a12821d34
  - [net-next,v2,05/11] net: dpaa2-mac: use lynx_pcs_create_fwnode()
    https://git.kernel.org/netdev/net-next/c/595fa7634d71
  - [net-next,v2,06/11] net: fman_memac: use lynx_pcs_create_fwnode()
    https://git.kernel.org/netdev/net-next/c/929a629c211f
  - [net-next,v2,07/11] net: pcs: lynx: make lynx_pcs_create() static
    https://git.kernel.org/netdev/net-next/c/84e476b876d9
  - [net-next,v2,08/11] net: pcs: lynx: change lynx_pcs_create() to return error-pointers
    https://git.kernel.org/netdev/net-next/c/05b606b88452
  - [net-next,v2,09/11] net: pcs: lynx: check that the fwnode is available prior to use
    https://git.kernel.org/netdev/net-next/c/d143898c6d7b
  - [net-next,v2,10/11] net: dpaa2: use pcs-lynx's check for fwnode availability
    https://git.kernel.org/netdev/net-next/c/8c1d0b339d67
  - [net-next,v2,11/11] net: fman_memac: use pcs-lynx's check for fwnode availability
    https://git.kernel.org/netdev/net-next/c/32fc30353f7c

You are awesome, thank you!