[PATCH net-next v4 0/4] net: add a regmap-based mdio driver and drop TSE PCS

Maxime Chevallier posted 4 patches 1 year, 4 months ago
MAINTAINERS                                   |  14 +-
drivers/net/ethernet/altera/Kconfig           |   2 +
drivers/net/ethernet/altera/altera_tse_main.c |  57 +++-
drivers/net/ethernet/stmicro/stmmac/Kconfig   |   3 +
drivers/net/ethernet/stmicro/stmmac/Makefile  |   2 +-
.../ethernet/stmicro/stmmac/altr_tse_pcs.c    | 257 ------------------
.../ethernet/stmicro/stmmac/altr_tse_pcs.h    |  29 --
drivers/net/ethernet/stmicro/stmmac/common.h  |   2 +
.../ethernet/stmicro/stmmac/dwmac-socfpga.c   |  91 +++++--
.../net/ethernet/stmicro/stmmac/stmmac_main.c |  12 +-
.../net/ethernet/stmicro/stmmac/stmmac_mdio.c |   3 +
drivers/net/mdio/Kconfig                      |  11 +
drivers/net/mdio/Makefile                     |   1 +
drivers/net/mdio/mdio-regmap.c                |  93 +++++++
drivers/net/pcs/Kconfig                       |   6 -
drivers/net/pcs/Makefile                      |   1 -
drivers/net/pcs/pcs-altera-tse.c              | 160 -----------
include/linux/mdio/mdio-regmap.h              |  26 ++
include/linux/pcs-altera-tse.h                |  17 --
19 files changed, 271 insertions(+), 516 deletions(-)
delete mode 100644 drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c
delete mode 100644 drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h
create mode 100644 drivers/net/mdio/mdio-regmap.c
delete mode 100644 drivers/net/pcs/pcs-altera-tse.c
create mode 100644 include/linux/mdio/mdio-regmap.h
delete mode 100644 include/linux/pcs-altera-tse.h
[PATCH net-next v4 0/4] net: add a regmap-based mdio driver and drop TSE PCS
Posted by Maxime Chevallier 1 year, 4 months ago
Hello everyone,

This is the V4 of a series that follows-up on the work [1] aiming to drop the
altera TSE PCS driver, as it turns out to be a version of the Lynx PCS exposed
as a memory-mapped block, instead of living on an MDIO bus.

One step of this removal involved creating a regmap-based mdio driver
that translates MDIO accesses into the actual underlying bus that
exposes the register. The register layout must of course match the
standard MDIO layout, but we can now account for differences in stride
with recent work on the regmap subsystem [2].

Sorry for repeating this, but I didn't hear anything on this matter in previous
iterations, Mark, Net maintainers, this series depends on the patch
e12ff2876493 that was recently merged into the regmap tree [3].

For this series to be usable in net-next, this patch must be applied
beforehand. Should Mark create a tag that would then be merged into
net-next ? Or should we just wait for the next release to merge this
into net-next ?

This series introduces a new MDIO driver, and uses it to convert Altera
TSE from the actual TSE PCS driver to Lynx PCS.

Since it turns out dwmac_socfpga also uses a TSE PCS block, port that
driver to Lynx as well.

Changes in V4 :
 - Use new pcs_lynx_create/destroy helpers added by Russell
 - Rework the cleanup sequence to avoid leaking data
 - Rework a bit KConfig to properly select dependencies
 - Fix a few hiccups with misplaced hunks in 2 commits

Changes in V3 :
 - Use a dedicated struct for the mii bus's priv data, to avoid
   duplicating the whole struct mdio_regmap_config, from which 2 fields
   only are necessary after init, as suggested by Russell
 - Use ~0 instead of ~0UL for the no-scan bitmask, following Simon's
   review.

Changes in V2 :
 - Use phy_mask to avoid unnecessarily scanning the whole mdio bus
 - Go one step further and completely disable scanning if users
   set the .autoscan flag to false, in case the mdiodevice isn't an
   actual PHY (a PCS for example).

Thanks,

Maxime

[1] : https://lore.kernel.org/all/20230324093644.464704-1-maxime.chevallier@bootlin.com/
[2] : https://lore.kernel.org/all/20230407152604.105467-1-maxime.chevallier@bootlin.com/#t
[3] : https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?id=e12ff28764937dd58c8613f16065da60da149048

Maxime Chevallier (4):
  net: mdio: Introduce a regmap-based mdio driver
  net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx
  net: pcs: Drop the TSE PCS driver
  net: stmmac: dwmac-sogfpga: use the lynx pcs driver

 MAINTAINERS                                   |  14 +-
 drivers/net/ethernet/altera/Kconfig           |   2 +
 drivers/net/ethernet/altera/altera_tse_main.c |  57 +++-
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |   3 +
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   2 +-
 .../ethernet/stmicro/stmmac/altr_tse_pcs.c    | 257 ------------------
 .../ethernet/stmicro/stmmac/altr_tse_pcs.h    |  29 --
 drivers/net/ethernet/stmicro/stmmac/common.h  |   2 +
 .../ethernet/stmicro/stmmac/dwmac-socfpga.c   |  91 +++++--
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  12 +-
 .../net/ethernet/stmicro/stmmac/stmmac_mdio.c |   3 +
 drivers/net/mdio/Kconfig                      |  11 +
 drivers/net/mdio/Makefile                     |   1 +
 drivers/net/mdio/mdio-regmap.c                |  93 +++++++
 drivers/net/pcs/Kconfig                       |   6 -
 drivers/net/pcs/Makefile                      |   1 -
 drivers/net/pcs/pcs-altera-tse.c              | 160 -----------
 include/linux/mdio/mdio-regmap.h              |  26 ++
 include/linux/pcs-altera-tse.h                |  17 --
 19 files changed, 271 insertions(+), 516 deletions(-)
 delete mode 100644 drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c
 delete mode 100644 drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h
 create mode 100644 drivers/net/mdio/mdio-regmap.c
 delete mode 100644 drivers/net/pcs/pcs-altera-tse.c
 create mode 100644 include/linux/mdio/mdio-regmap.h
 delete mode 100644 include/linux/pcs-altera-tse.h

-- 
2.40.1
Re: [PATCH net-next v4 0/4] net: add a regmap-based mdio driver and drop TSE PCS
Posted by patchwork-bot+netdevbpf@kernel.org 1 year, 4 months ago
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu,  1 Jun 2023 16:14:50 +0200 you wrote:
> Hello everyone,
> 
> This is the V4 of a series that follows-up on the work [1] aiming to drop the
> altera TSE PCS driver, as it turns out to be a version of the Lynx PCS exposed
> as a memory-mapped block, instead of living on an MDIO bus.
> 
> One step of this removal involved creating a regmap-based mdio driver
> that translates MDIO accesses into the actual underlying bus that
> exposes the register. The register layout must of course match the
> standard MDIO layout, but we can now account for differences in stride
> with recent work on the regmap subsystem [2].
> 
> [...]

Here is the summary with links:
  - [net-next,v4,1/4] net: mdio: Introduce a regmap-based mdio driver
    https://git.kernel.org/netdev/net-next/c/642af0f92cbe
  - [net-next,v4,2/4] net: ethernet: altera-tse: Convert to mdio-regmap and use PCS Lynx
    https://git.kernel.org/netdev/net-next/c/db48abbaa18e
  - [net-next,v4,3/4] net: pcs: Drop the TSE PCS driver
    https://git.kernel.org/netdev/net-next/c/196eec4062b0
  - [net-next,v4,4/4] net: stmmac: dwmac-sogfpga: use the lynx pcs driver
    https://git.kernel.org/netdev/net-next/c/5d1f3fe7d2d5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH net-next v4 0/4] net: add a regmap-based mdio driver and drop TSE PCS
Posted by Maxime Chevallier 1 year, 4 months ago
Dear Maintainers,

Thanks for applying the patch, however as mentionned (maybe not
stressed enough in the cover) this series depends on a patch that went
through the regmap tree :


 https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?id=e12ff28764937dd58c8613f16065da60da149048

How can we proceed on that matter ?

Thanks,

Maxime

On Mon, 05 Jun 2023 10:30:24 +0000
patchwork-bot+netdevbpf@kernel.org wrote:

> Hello:
> 
> This series was applied to netdev/net-next.git (main)
> by David S. Miller <davem@davemloft.net>:
> 
> On Thu,  1 Jun 2023 16:14:50 +0200 you wrote:
> > Hello everyone,
> > 
> > This is the V4 of a series that follows-up on the work [1] aiming
> > to drop the altera TSE PCS driver, as it turns out to be a version
> > of the Lynx PCS exposed as a memory-mapped block, instead of living
> > on an MDIO bus.
> > 
> > One step of this removal involved creating a regmap-based mdio
> > driver that translates MDIO accesses into the actual underlying bus
> > that exposes the register. The register layout must of course match
> > the standard MDIO layout, but we can now account for differences in
> > stride with recent work on the regmap subsystem [2].
> > 
> > [...]  
> 
> Here is the summary with links:
>   - [net-next,v4,1/4] net: mdio: Introduce a regmap-based mdio driver
>     https://git.kernel.org/netdev/net-next/c/642af0f92cbe
>   - [net-next,v4,2/4] net: ethernet: altera-tse: Convert to
> mdio-regmap and use PCS Lynx
> https://git.kernel.org/netdev/net-next/c/db48abbaa18e
>   - [net-next,v4,3/4] net: pcs: Drop the TSE PCS driver
>     https://git.kernel.org/netdev/net-next/c/196eec4062b0
>   - [net-next,v4,4/4] net: stmmac: dwmac-sogfpga: use the lynx pcs
> driver https://git.kernel.org/netdev/net-next/c/5d1f3fe7d2d5
> 
> You are awesome, thank you!
Re: [PATCH net-next v4 0/4] net: add a regmap-based mdio driver and drop TSE PCS
Posted by Jakub Kicinski 1 year, 4 months ago
On Mon, 5 Jun 2023 14:20:39 +0200 Maxime Chevallier wrote:
> Thanks for applying the patch, however as mentionned (maybe not
> stressed enough in the cover) this series depends on a patch that went
> through the regmap tree :
> 
> 
>  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?id=e12ff28764937dd58c8613f16065da60da149048
> 
> How can we proceed on that matter ?

I don't see a great solution, Mark already applied the change and 
so did Dave. Don't think we can put them on stable branches now..

Only altera and stmmac-sogfpga are going to break?
Maybe we're close enough to the merge window to put our heads 
in the sand and wait?
Re: [PATCH net-next v4 0/4] net: add a regmap-based mdio driver and drop TSE PCS
Posted by Maxime Chevallier 1 year, 4 months ago
Hello Jakub,

On Mon, 5 Jun 2023 11:46:26 -0700
Jakub Kicinski <kuba@kernel.org> wrote:

> On Mon, 5 Jun 2023 14:20:39 +0200 Maxime Chevallier wrote:
> > Thanks for applying the patch, however as mentionned (maybe not
> > stressed enough in the cover) this series depends on a patch that went
> > through the regmap tree :
> > 
> > 
> >  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git/commit/?id=e12ff28764937dd58c8613f16065da60da149048
> > 
> > How can we proceed on that matter ?  
> 
> I don't see a great solution, Mark already applied the change and 
> so did Dave. Don't think we can put them on stable branches now..
> 
> Only altera and stmmac-sogfpga are going to break?
> Maybe we're close enough to the merge window to put our heads 
> in the sand and wait?

only these two should, indeed. I'll still followup with some fixes for
kbuild issues still.

Thanks,

Maxime