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] [day] [month] [year] [list]
Message-ID: <ZICjm8WsSPAa6YJo@corigine.com>
Date: Wed, 7 Jun 2023 17:34:51 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
	Feiyang Chen <chenfeiyang@...ngson.cn>, peppe.cavallaro@...com,
	alexandre.torgue@...s.st.com, joabreu@...opsys.com,
	netdev@...r.kernel.org, loongson-kernel@...ts.loongnix.cn,
	chris.chenfeiyang@...il.com, Yanteng Si <siyanteng@...ngson.cn>
Subject: Re: [PATCH] net: stmmac: Fix stmmac_mdio_unregister() build errors

On Wed, Jun 07, 2023 at 04:02:19PM +0200, Maxime Chevallier wrote:
> Hello,
> 
> On Wed, 7 Jun 2023 13:55:41 +0200
> Maciej Fijalkowski <maciej.fijalkowski@...el.com> wrote:
> 
> > On Wed, Jun 07, 2023 at 05:34:40PM +0800, Feiyang Chen wrote:
> > > When CONFIG_PCS_LYNX is not set, lynx_pcs_destroy() will not be
> > > exported. Add #ifdef CONFIG_PCS_LYNX around that code to avoid
> > > build errors like these:
> > > 
> > > ld: drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o: in function `stmmac_mdio_unregister':
> > > stmmac_mdio.c:(.text+0x1440): undefined reference to `lynx_pcs_destroy'
> > > 
> > > Reported-by: Yanteng Si <siyanteng@...ngson.cn>
> > > Fixes: 5d1f3fe7d2d5 ("net: stmmac: dwmac-sogfpga: use the lynx pcs driver")
> > > Signed-off-by: Feiyang Chen <chenfeiyang@...ngson.cn>
> > > ---
> > >  drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> > > index c784a6731f08..c1a23846a01c 100644
> > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> > > @@ -665,8 +665,10 @@ int stmmac_mdio_unregister(struct net_device *ndev)
> > >  	if (priv->hw->xpcs)
> > >  		xpcs_destroy(priv->hw->xpcs);
> > >  
> > > +#ifdef CONFIG_PCS_LYNX  
> > 
> > wouldn't it be better to provide a stub of lynx_pcs_destroy() for
> > !CONFIG_PCS_LYNX ? otherwise all of the users will have to surrounded with
> > this ifdef.
> 
> I just sent another fix that has been in the works since yesterday :
> 
> https://lore.kernel.org/netdev/20230607135941.407054-1-maxime.chevallier@bootlin.com/T/#t
> 
> It uses a better solution of only using pcs_lynx-related helpers on dwmac_socfpga,
> as this is the only stmmac variant that needs this PCS.
> 
> Sorry for the mess,
> 
> Maxime

Thanks everyone, and sorry for my part in this mess.
Let's keep working on the solution at the thread above.

-- 
pw-bot: reject


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ