Re: [PATCH RFC net-next] net: phy: add (*register_phy)() hook to struct mii_bus
From: Andrew Lunn
Date: Wed Jan 21 2026 - 16:33:36 EST
On Wed, Jan 21, 2026 at 09:12:56PM +0000, Daniel Golle wrote:
> Some MDIO busses require to program PHY polling registers depending on
> the PHY type. RealTek switch SoCs are the most prominent example of a
> DSA switch which doesn't allow to program MAC speed, duplex and
> flow-control settings without using PHY polling to do so.
>
> Hence there is a need to inform the MDIO bus driver that a PHY has been
> registered on the bus, as otherwise the bus driver will have to reinvent
> and duplicate all the bus scanning logic for Clause-22 and Clause-45
> PHYs.
>
> Provide a simple hook in struct mii_bus which is called right after a
> PHY has been registered on the bus.
>
> Alternative ways which would allow to do the same things without
> having to change any kernel code would of course be very welcome.
You need to provide a user of this new API as part of the patchset. To
deciding if an API makes sense you often need to see both sides of it.
Andrew
---
pw-bot: cr