Re: [PATCH net-next 1/2] net: stmmac: Add PCS_LYNX as a dependency for the whole driver

From: Russell King (Oracle)
Date: Tue Jun 06 2023 - 05:30:56 EST


On Tue, Jun 06, 2023 at 10:29:20AM +0200, Geert Uytterhoeven wrote:
> Hi Maxime,
>
> On Tue, 6 Jun 2023, Maxime Chevallier wrote:
> > Although pcs_lynx is only used on dwmac_socfpga for now, the cleanup
> > path is in the generic driver, and triggers build issues for other
> > stmmac variants. Make sure we build pcs_lynx in all cases too, as for
> > XPCS.
>
> That seems suboptimal to me, as it needlesly increases kernel size for
> people who do not use dwmac_socfpga. Hence I made an alternative patch:
> https://lore.kernel/org/7b36ac43778b41831debd5c30b5b37d268512195.1686039915.git.geert+renesas@xxxxxxxxx

A better solution would be to re-architect the removal code so that
whatever creates the PCS is also responsible for removing it.

Also, dwmac_socfpga nees to be reorganised anyway, because it calls
stmmac_dvr_probe() which then goes on to call register_netdev(),
publishing the network device, and then after stmmac_dvr_probe(),
further device setup is done. As the basic driver probe flow should
be setup and then publish, the existing code structure violates that.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!