netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] net: phy: remove fixed_phy_add and first its users
@ 2025-10-30 21:39 Heiner Kallweit
  2025-10-30 21:41 ` [PATCH net-next 1/6] net: phy: fixed_phy: add helper fixed_phy_register_100fd Heiner Kallweit
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Heiner Kallweit @ 2025-10-30 21:39 UTC (permalink / raw)
  To: Greg Ungerer, Geert Uytterhoeven, Hauke Mehrtens,
	Rafał Miłecki, Thomas Bogendoerfer, Michael Chan,
	Wei Fang, Shenwei Wang, Clark Wang, Russell King - ARM Linux,
	Andrew Lunn, Andrew Lunn, Jakub Kicinski, Paolo Abeni,
	David Miller, Eric Dumazet
  Cc: linux-m68k, linux-mips, imx, netdev@vger.kernel.org

fixed_phy_add() has a number of problems/disadvantages:
- It uses phy address 0 w/o checking whether a fixed phy with this
  address exists already.
- A subsequent call to fixed_phy_register() would also use phy address 0,
  because fixed_phy_add() doesn't mark it as used.
- fixed_phy_add() is used from platform code, therefore requires that
  fixed phy code is built-in.

fixed_phy_add() has only two users
- coldfire/5272, using fec
- bcm47xx, using b44

So migrate fec and b44 to use fixed_phy_register_100fd(), afterwards
remove usage of fixed_phy_add() from the two platforms, and eventually
remove fixed_phy_add().

When I proposed helper fixed_phy_register_100fd() first, there was
the question whether it's worth it, and Jakub asked to submit the
full series:
https://lore.kernel.org/netdev/20251021182021.15223c1e@kernel.org/
Apart from this series, there are two more places where the helper
can be used to simplify the code: dsa_loop, ftgmac100
I left this for a follow-up.

Heiner Kallweit (6):
  net: phy: fixed_phy: add helper fixed_phy_register_100fd
  net: fec: register a fixed phy using fixed_phy_register_100fd if
    needed
  m68k: coldfire: remove creating a fixed phy
  net: b44: register a fixed phy using fixed_phy_register_100fd if
    needed
  MIPS: BCM47XX: remove creating a fixed phy
  net: phy: fixed_phy: remove fixed_phy_add

 arch/m68k/coldfire/m5272.c                | 15 -------
 arch/mips/bcm47xx/setup.c                 |  7 ---
 drivers/net/ethernet/broadcom/Kconfig     |  1 +
 drivers/net/ethernet/broadcom/b44.c       | 37 ++++++++--------
 drivers/net/ethernet/freescale/Kconfig    |  1 +
 drivers/net/ethernet/freescale/fec_main.c | 52 +++++++++++------------
 drivers/net/phy/fixed_phy.c               | 18 +++++---
 include/linux/phy_fixed.h                 |  8 +++-
 8 files changed, 66 insertions(+), 73 deletions(-)

-- 
2.51.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-11-05  2:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 21:39 [PATCH net-next 0/6] net: phy: remove fixed_phy_add and first its users Heiner Kallweit
2025-10-30 21:41 ` [PATCH net-next 1/6] net: phy: fixed_phy: add helper fixed_phy_register_100fd Heiner Kallweit
2025-10-30 21:42 ` [PATCH net-next 2/6] net: fec: register a fixed phy using fixed_phy_register_100fd if needed Heiner Kallweit
2025-10-31  3:36   ` Wei Fang
2025-10-31  8:01     ` Heiner Kallweit
2025-11-03  3:11       ` Greg Ungerer
2025-11-03  3:15   ` Greg Ungerer
2025-11-03  7:36     ` Heiner Kallweit
2025-10-30 21:43 ` [PATCH net-next 3/6] m68k: coldfire: remove creating a fixed phy Heiner Kallweit
2025-10-30 21:44 ` [PATCH net-next 4/6] net: b44: register a fixed phy using fixed_phy_register_100fd if needed Heiner Kallweit
2025-10-30 21:45 ` [PATCH net-next 5/6] MIPS: BCM47XX: remove creating a fixed phy Heiner Kallweit
2025-10-30 21:46 ` [PATCH net-next 6/6] net: phy: fixed_phy: remove fixed_phy_add Heiner Kallweit
2025-11-05  2:50 ` [PATCH net-next 0/6] net: phy: remove fixed_phy_add and first its users patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).