[net-next,v2,0/8] net: stmmac: mdio related cleanups

Message ID aald--qJquWGIvmO@shell.armlinux.org.uk (mailing list archive)
Headers
Series net: stmmac: mdio related cleanups |

Message

Russell King (Oracle) March 5, 2026, 10:42 a.m. UTC
Hi,

The first four patches clean up the MDC clock divisor selection code,
turning the three different ways we choose a divisor into tabular form,
rather than doing the selection purely in code.

Convert MDIO to use field_prep() which allows a non-constant mask to be
used when preparing fields.

Then use u32 and the associated typed GENMASK for MDIO register field
definitions.

Finally, an extra couple of patches that use appropriate types in
struct mdio_bus_data.

v2:
- add comments about 300MHz to commit message in patch 1
- fix incorrect usage of stmmac_sun8i_csr_to_mdc in patch 3
- fix BIT_u32()->BIT_U32() in patch 8

 drivers/net/ethernet/stmicro/stmmac/common.h       |  10 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c  |   2 +-
 .../net/ethernet/stmicro/stmmac/dwmac-loongson.c   |  11 +--
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |   9 +-
 .../net/ethernet/stmicro/stmmac/dwmac1000_core.c   |   9 +-
 .../net/ethernet/stmicro/stmmac/dwmac100_core.c    |   9 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c  |   9 +-
 .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c    |  18 ++--
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c  | 106 ++++++++++++---------
 include/linux/stmmac.h                             |   6 +-
 10 files changed, 92 insertions(+), 97 deletions(-)
  

Comments

Maxime Chevallier March 6, 2026, 1:49 p.m. UTC | #1
Hi,

On 05/03/2026 11:42, Russell King (Oracle) wrote:
> Hi,
> 
> The first four patches clean up the MDC clock divisor selection code,
> turning the three different ways we choose a divisor into tabular form,
> rather than doing the selection purely in code.
> 
> Convert MDIO to use field_prep() which allows a non-constant mask to be
> used when preparing fields.
> 
> Then use u32 and the associated typed GENMASK for MDIO register field
> definitions.
> 
> Finally, an extra couple of patches that use appropriate types in
> struct mdio_bus_data.
> 
> v2:
> - add comments about 300MHz to commit message in patch 1
> - fix incorrect usage of stmmac_sun8i_csr_to_mdc in patch 3
> - fix BIT_u32()->BIT_U32() in patch 8

I have tested this series as a whole on 2 platforms using the dwmac mdio
driver (socfpga - KSZ9031 / imx8mp + KSZ9131), no regressions found. I'm
not stressing the 300M case though.

feel free to add my :

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

Maxime

>  drivers/net/ethernet/stmicro/stmmac/common.h       |  10 +-
>  drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c  |   2 +-
>  .../net/ethernet/stmicro/stmmac/dwmac-loongson.c   |  11 +--
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |   9 +-
>  .../net/ethernet/stmicro/stmmac/dwmac1000_core.c   |   9 +-
>  .../net/ethernet/stmicro/stmmac/dwmac100_core.c    |   9 +-
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c  |   9 +-
>  .../net/ethernet/stmicro/stmmac/dwxgmac2_core.c    |  18 ++--
>  drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c  | 106 ++++++++++++---------
>  include/linux/stmmac.h                             |   6 +-
>  10 files changed, 92 insertions(+), 97 deletions(-)
>
  
patchwork-bot+netdevbpf@kernel.org March 6, 2026, 11:50 p.m. UTC | #2
Hello:

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

On Thu, 5 Mar 2026 10:42:03 +0000 you wrote:
> Hi,
> 
> The first four patches clean up the MDC clock divisor selection code,
> turning the three different ways we choose a divisor into tabular form,
> rather than doing the selection purely in code.
> 
> Convert MDIO to use field_prep() which allows a non-constant mask to be
> used when preparing fields.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/8] net: stmmac: mdio: convert MDC clock divisor selection to tables
    https://git.kernel.org/netdev/net-next/c/4c7e0e081889
  - [net-next,v2,2/8] net: stmmac: mdio: use same test for MDC clock divisor lookups
    https://git.kernel.org/netdev/net-next/c/b6687ef97603
  - [net-next,v2,3/8] net: stmmac: mdio: simplify MDC clock divisor lookup
    https://git.kernel.org/netdev/net-next/c/506f78f43c58
  - [net-next,v2,4/8] net: stmmac: mdio: convert field prep to use field_prep()
    https://git.kernel.org/netdev/net-next/c/58bd0039002b
  - [net-next,v2,5/8] net: stmmac: use u32 for MDIO register field masks
    https://git.kernel.org/netdev/net-next/c/df388b4d3913
  - [net-next,v2,6/8] net: stmmac: use GENMASK_U32() for mdio bitfields
    https://git.kernel.org/netdev/net-next/c/a64d927aecf1
  - [net-next,v2,7/8] net: stmmac: mdio_bus_data->default_an_inband is boolean
    https://git.kernel.org/netdev/net-next/c/3cd963fa915c
  - [net-next,v2,8/8] net: stmmac: make pcs_mask and phy_mask u32
    https://git.kernel.org/netdev/net-next/c/e4fd855c52ec

You are awesome, thank you!