Re: [PATCH] net: usb: lan78xx: add weak dependency with micrel phy module

From: Lucas De Marchi
Date: Thu Jul 25 2024 - 00:26:07 EST


On Thu, Jul 25, 2024 at 12:57:05AM GMT, Andrew Lunn wrote:
For the commented case, I have included only one phy because it is the hardware
that I have, but other phy devices (modules) are possible and they can be some.

So this the whole whacker a mole problem. It works for you but fails
for 99% of users. How is this helping us?

no, this is the first instance that was found/added.

if you declare a softdep what happens is that the dep is loaded first
(needed or not) and your module is loaded after that

if you declare a weakdep, you are just instructing the tools that the
module may or may not be needed. Any module today that does a
request_module("foo") could be a candidate to migrate from
MODULE_SOFTDEP("pre: foo") to the new weakdep, as long as it handles
properly the module being loaded ondemand as opposed to using
request_module() to just synchronize the module being loaded.


Maybe a better solution is to first build an initramfs with
everything, plus the kitchen sink. Boot it, and then look at what has
been loaded in order to get the rootfs mounted. Then update the
initramfs with just what is needed? That should be pretty generic,
with throw out networking ig NFS root is not used, just load JFFS2 and
a NAND driver if it was used for the rootfs, etc.

that works for development systems or if you are fine tuning it for each
system you have. It doesn't work for a generic distro with the kitchen
sink of modules and still trying to minimize the initrd without end user
intervention. So it works for 99% of users.

Lucas De Marchi


Andrew