Re: [PATCH v2 10/19] net: phy: Use the compatibility driver attachment API
From: Leon Romanovsky
Date: Tue Nov 10 2026 - 02:41:21 EST
On Mon, Nov 09, 2026 at 02:45:35PM +0100, Andrew Lunn wrote:
> > @@ -1956,11 +1958,10 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
> > }
> > phydev->drv_owner = drv_owner;
> >
> > - if (phydev->is_genphy_driven) {
> > - err = d->driver->probe(d);
> > - if (err >= 0)
> > - err = device_bind_driver(d);
> > -
> > + if (bind_genphy) {
> > + err = device_driver_attach_full(drv, d);
> > + if (err == -EBUSY)
> > + irq = phydev->irq;
>
> Just looking at this, it is not clear where the EBUSY can from?
I relied on the comment above: “Assume that if there is no driver, ...”.
Since PHYs do not use the standard automatic probing mechanism, I have no
way to tell whether a driver is already bound.
> And why set irq to phydev->irq?
If the above operation can fail with -EBUSY, the wrong IRQ was restored.
I checked this with AI, which says that -EBUSY can originate deep in the
driver core. It may be better to remove this special case and rely on the
PHY's guarantee that no driver can be bound concurrently.
Thanks
>
> Andrew