public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dragan Simic <dsimic@manjaro.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>,
	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,
	masahiroy@kernel.org, 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 16:10:57 +0200	[thread overview]
Message-ID: <a520ee4da331c8edb99f2c14d22a3531@manjaro.org> (raw)
In-Reply-To: <3e895811-ad23-4687-b440-5375ad2af2ff@lunn.ch>

Hello Andrew,

On 2024-07-28 01:29, Andrew Lunn wrote:
>> Before going into explaining my viewpoint, could someone, please, 
>> clarify
>> which LAN78xx USB-to-Ethernet bridge does this apply to?  I already 
>> had
>> a look at a few LAN78xx datasheets, and I'm not sure how the external 
>> PHY
>> becomes exposed over the USB interface, so it needs a driver.
> 
> https://elixir.bootlin.com/linux/v6.10/source/drivers/net/usb/lan78xx.c#L2049
> 
> This is creating an MDIO bus device. The MDIO bus will be scanned and
> PHYs on the bus found. There are then a few calls to phy_find_first()
> which will get the PHY.
> 
> The code itself looks pretty broken, it is directly accessing PHY
> registers, which a MAC driver should not do. That is a layering
> violation.

Thanks for the clarification.

Basically, the way I see it, weakdeps are the right solution for the
problem at hand, i.e. for the generation of the initial ramdisk with
all the possible PHY driver modules.  However, I don't think that some
automagical generation of the associated MODULE_WEAKDEP() statements
is the way to go.  Instead, all those statements should be added by
hand to the lan78xx driver, making sure that each PHY is tested and
validated beforehand.

  reply	other threads:[~2024-07-28 14:11 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 [this message]
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
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=a520ee4da331c8edb99f2c14d22a3531@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