Subject: Re: [PATCH] net: phy: don't issue a module request if a driver is available

From: Niklas Cassel <[email-masked]>
Date: Fri, 3 Jan 2025 15:34:26 +0100

On Fri, Jan 03, 2025 at 03:12:14PM +0100, Andrew Lunn wrote:
> > FWIW, the patch in $subject does make the splat go away for me.
> > (I have the PHY driver built as built-in).
> > 
> > The patch in $subject does "Add a list of registered drivers and check
> > if one is already available before resorting to call request_module();
> > in this way, if the PHY driver is already there, the MDIO bus can perform
> > the async probe."
> 
> Lets take a step backwards.
> 
> How in general should module loading work with async probe? Lets
> understand that first.
> 
> Then we can think about what is special about PHYs, and how we can fit
> into the existing framework.

I agree that it might be a good idea, if possible, for request_module()
itself to see if the requested module is already registered, and then do
nothing.

Adding Luis (modules maintainer) to CC.

Luis, phylib calls request_module() unconditionally, regardless if there
is a driver registered already (phy driver built as built-in).

This causes the splat described here to be printed:
https://lore.kernel.org/netdev/[email-masked]/T/#u

But as far as I can tell, this is a false positive, since the call cannot
possibly load any module (since the driver is built as built-in and not
as a module).

Kind regards,
Niklas