Thread (4 messages) 4 messages, 2 authors, 2024-06-14

Re: [PATCH] fec_main: Register net device before initializing the MDIO bus

From: Paul Geurts <hidden>
Date: 2024-06-14 08:40:54
Also in: imx, lkml

On Thu, Jun 13, 2024 at 04:41:11PM +0200, Paul Geurts wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help