Re: [PATCH v3 18/31] net: phy: Use the compatibility driver attachment API

From: Leon Romanovsky

Date: Thu Nov 19 2026 - 02:18:32 EST


On Wed, Nov 18, 2026 at 09:21:45PM +0100, Andrew Lunn wrote:
> > @@ -3813,6 +3809,8 @@ static int phy_probe(struct device *dev)
> > int err = 0;
> >
> > phydev->drv = phydrv;
> > + phydev->is_genphy_driven = phydrv == &genphy_driver ||
> > + phydrv == &genphy_c45_driver;
> >
>
> Why do this here?

This flag marks that driver is already probed, which is reliably
happening in phy_probe() under right locks. It was the easiest
way to battle AI reviews which don't agree with how PHY subsystem
performs driver bound.

>
> It also makes the code asymmetric. If you set it in phy_probe, you
> should unset it in phy_remove. At the moment, it is symmetric,
> phy_attach_direct sets it, phy_detach clears it.

is_genphy_driven management was moved from attach/detach to
probe/remove, so it is not set in attach anymore. It aligns now
with how phydev->drv is handled, which was set to NULL phy_remove(),
see commit 00db8189d984 ("This patch adds a PHY Abstraction ...").

So I would say that now it is more aligned with what PHY does and more
symmetric than before.

Thanks

>
> Andrew