Thread (9 messages) flat view 9 messages, 2 authors, 2021-03-29

RE: FEC unbind/bind feature

From: Joakim Zhang <hidden>
Date: 2021-03-29 09:15:01

-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch>
Sent: 2021年3月26日 20:34
To: Joakim Zhang <redacted>
Cc: Florian Fainelli <f.fainelli@gmail.com>; hkallweit1@gmail.com;
netdev@vger.kernel.org
Subject: Re: FEC unbind/bind feature
quoted
One more add, yes, I am looking the drivers/net/mdio, it is better to
implement standalone MDIO driver when writing the MAC driver at the
beginning.
quoted
Now if I abstract MDIO driver from FEC driver, dt bindings would change, it
will break all existing implementations in the kernel based on FEC driver, let
them can't work.
quoted
How to compatible the legacy dt bindings? I have no idea now. At the same
time, I also feel that it seems not necessary to rewrite it.

I have a reasonable understanding of the FEC MDIO driver. I have broken it a
few times :-)

It is going to be hard to make it an independent driver, because it needs access
to the interrupt flags and the clocks for power saving. From a hardware
perspective, it is not an independent hardware block, it is integrated into the
MAC.
Agree 😊

For another curiosity, dual FEC instances share one MDIO bus, we can successfully unbind them one by one. But if users first unbind FEC which attached MDIO bus, kernel would have a dump or crash, it seems not good.
So I look at the code, want to find a way to reject unbind this FEC first, then print a log, something like "other FEC instances depend on MDIO bus of this FEC, so can't unbind it now". It seems no way to do this at FEC driver remove path (fec_drv_remove). If you have some idea, happy share with me. Thanks.

Best Regards,
Joakim Zhang
XDP probably is your easier path.

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help