netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>,
	andrew@lunn.ch, UNGLinuxDriver@microchip.com,
	davem@davemloft.net, edumazet@google.com, f.fainelli@gmail.com,
	gregkh@linuxfoundation.org, kuba@kernel.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, lucas.demarchi@intel.com,
	mcgrof@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com,
	woojung.huh@microchip.com
Subject: Re: [PATCH] net: usb: lan78xx: add weak dependency with micrel phy module
Date: Sun, 28 Jul 2024 11:53:08 +0200	[thread overview]
Message-ID: <fa9fa543c4c8ca4e8ec54744e2e07efb@manjaro.org> (raw)
In-Reply-To: <CAK7LNARg-xxm3FecQ654OnxcMGtc8BjsXmZsymaNKnr_6sM=zw@mail.gmail.com>

Hello Masahiro,

On 2024-07-28 09:37, Masahiro Yamada wrote:
> On Fri, Jul 26, 2024 at 9:15 PM Jose Ignacio Tornos Martinez
> <jtornosm@redhat.com> wrote:
>> > What this does appear to do is differentiate between 'pre' which will
>> > load the kernel module before it is requested. Since there is no 'pre'
>> > for this, it seems pointless whacking this mole.
>> Precisely, we need to fix the lan78xx case with micrel phy (and other
>> possible phy modules) too, due to the commented issue generating 
>> initramfs
>> in order to include the phy module.
>> 
>> > What to me make more sense it to look at all the existing 'pre'
>> > drivers and determine if they can be converted to use this macro.
>> Of course, now that we have the possibility we can do this with other 
>> cases
>> that have been already detected (and fixed with a softdep pre) and 
>> others
>> still not detected (if anyone apart from lan78xx).
> 
> I am not familiar with MAC/PHY interface, but perhaps the
> situation might be different on internal/external PHYs?
> 
> I do not know if "micrel" is an internal or an external PHY, though.
> 
> [1] internal PHY
> 
> Commit e57cf3639c323eeed05d3725fd82f91b349adca8 moved the
> internal PHY code from drivers/net/usb/lan78xx.c
> to drivers/net/phy/microchip.c
> 
> So, lan78xx.ko is likely to use microchip.ko
> 
> Perhaps, is the following useful?
> 
>   MODULE_WEAKDEP("microchip");    /* internal PHY */
> 
> Or, is this the case for MODULE_SOFTDEP()?
> 
> [2] external PHY
> 
> When an external PHY device is connected, the MAC/PHY combination is
> pretty much board-specific. We may end up with
> a bunch of MODULE_WEAKDEP().
> 
> The second question is, is it so important to enable network
> at the initramfs time? Personally, I am fine with having network
> drivers in the root file system.
> 
> Is this useful when the root file system is nfs or something?

The troubles happen when the driver is probed during the initial
ramdisk stage, e.g. when a machine is rebooted with a USB adapter
plugged in.  If the required dependent PHY driver module isn't also
found in the initial ramdisk, probing the main driver may actually
fail or (hopefully not) end up in some strange state.

If you have time, I'd suggest that you go through the following
related discussions, which should provide further clarification
and additional examples of such issues with initial ramdisks and
additional driver modules:

- 
https://lore.kernel.org/linux-modules/04e0676b0e77c5eb69df6972f41d77cdf061265a.1721906745.git.dsimic@manjaro.org/
- 
https://lore.kernel.org/dri-devel/4e1e00422a14db4e2a80870afb704405da16fd1b.1718655077.git.dsimic@manjaro.org/T/#u
- 
https://lore.kernel.org/dri-devel/fdaf2e41bb6a0c5118ff9cc21f4f62583208d885.1718655070.git.dsimic@manjaro.org/T/#u

  reply	other threads:[~2024-07-28  9:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 10:23 [PATCH] net: usb: lan78xx: add weak dependency with micrel phy module Jose Ignacio Tornos Martinez
2024-07-24 11:49 ` Andrew Lunn
2024-07-24 13:36   ` Greg KH
2024-07-24 14:46     ` Jose Ignacio Tornos Martinez
2024-07-24 15:31       ` Florian Fainelli
2024-07-24 14:54     ` Jose Ignacio Tornos Martinez
2024-07-24 16:10       ` Jose Ignacio Tornos Martinez
2024-07-24 22:57         ` Andrew Lunn
2024-07-25  4:25           ` Lucas De Marchi
2024-07-25  4:42             ` Florian Fainelli
2024-07-25  6:50               ` Lucas De Marchi
2024-07-25  9:53                 ` Paolo Abeni
2024-07-26 11:33                   ` Andrew Lunn
2024-07-26 12:15                     ` Jose Ignacio Tornos Martinez
2024-07-26 20:59                       ` Andrew Lunn
2024-07-27 17:15                         ` Dragan Simic
2024-07-27 23:29                           ` Andrew Lunn
2024-07-28 14:10                             ` Dragan Simic
2024-07-28 19:45                               ` Andrew Lunn
2024-07-28 20:46                                 ` Dragan Simic
2024-07-28 20:57                                   ` Andrew Lunn
2024-07-29  4:43                                     ` Dragan Simic
2024-07-29  6:13                                       ` Greg KH
2024-07-29  6:29                                         ` Dragan Simic
2024-07-29  8:34                                           ` Jose Ignacio Tornos Martinez
2024-07-29  9:28                                             ` Dragan Simic
2024-07-29 12:32                                               ` Jose Ignacio Tornos Martinez
2024-07-29 18:56                                                 ` Andrew Lunn
2024-07-30  7:55                                                   ` Jose Ignacio Tornos Martinez
2024-07-28  7:37                       ` Masahiro Yamada
2024-07-28  9:53                         ` Dragan Simic [this message]
2024-07-26 14:49           ` Jakub Kicinski
2024-07-26 21:15             ` Andrew Lunn
2024-07-29  8:37               ` Jose Ignacio Tornos Martinez
2024-07-29 12:42                 ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa9fa543c4c8ca4e8ec54744e2e07efb@manjaro.org \
    --to=dsimic@manjaro.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jtornosm@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).