Re: [PATCH 03/17] net: phy: Attach generic PHY drivers through the driver core
From: Leon Romanovsky
Date: Thu Nov 05 2026 - 13:35:50 EST
On Thu, Nov 05, 2026 at 03:50:35PM +0100, Andrew Lunn wrote:
> On Thu, Nov 05, 2026 at 01:42:16PM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@xxxxxxxxxx>
> >
> > The generic PHY fallback probes directly before publishing its binding,
> > bypassing driver-core admission and supplier checks.
> >
> > Attach through the driver core so admission precedes functional setup.
> > Callers hold RTNL, which a concurrent bind of a specific driver may wait
> > for with the device lock held, so for this flow let's add
> > device_driver_try_attach() so the attachment never waits for that lock.
>
> FYI: This code is fragile, and causes issues. I will need to stare
> long and hard at it before accepting it. So i'm unlikely to do that
> until the basic idea is accepted.
In order to accept basic idea, we need to change PHY code hold device
lock when binding the driver.
>
> I also wounder how a PHY is a threat. What is your threat model for an
> Ethernet PHY?
There is no special threat model for X or Y. Everything that requires
drivers to be bound are expected behave the same - honor trust level
policy.
Thanks
>
> Andrew