lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240614084050.1205641-1-paul.geurts@prodrive-technologies.com>
Date: Fri, 14 Jun 2024 10:40:50 +0200
From: Paul Geurts <paul.geurts@...drive-technologies.com>
To: <andrew@...n.ch>
CC: <wei.fang@....com>, <shenwei.wang@....com>, <xiaoning.wang@....com>,
	<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <imx@...ts.linux.dev>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, Paul Geurts
	<paul.geurts@...drive-technologies.com>
Subject: Re: [PATCH] fec_main: Register net device before initializing the MDIO bus

> On Thu, Jun 13, 2024 at 04:41:11PM +0200, Paul Geurts wrote:
> > Registration of the FEC MDIO bus triggers a probe of all devices
> > connected to that bus. DSA based Ethernet switch devices connect to the
> > uplink Ethernet port during probe. When a DSA based, MDIO controlled
> > Ethernet switch is connected to FEC, it cannot connect the uplink port,
> > as the FEC MDIO port is registered before the net device is being
> > registered. This causes an unnecessary defer of the Ethernet switch
> > driver probe.
> > 
> > Register the net device before initializing and registering the MDIO
> > bus.
> 
> The problem with this is, as soon as you call register_netdev(), the
> device is alive and sending packets. It can be sending packets even
> before register_netdev() returns, e.g. in the case of NFS root. So
> fec_enet_open() gets called, and tried to find its PHY. But the MDIO
> bus is not registered yet....

Valid argument there. I was trying to make the initialization more efficient,
but you are correct.

> 
> So yes, DSA ends up doing an EPROBE_DEFER cycle. Not much we can do
> about that. We can try to keep the DSA probe functions as cheap as
> possible, and put all the expensive stuff in setup(), which will only
> be called once we have all the needed resources.
> 
>     Andrew
> 
> ---
> pw-bot: cr
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ