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: <20231128182641.7e2363c0@device.home>
Date: Tue, 28 Nov 2023 18:26:41 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com, Jakub Kicinski
 <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, linux-arm-kernel@...ts.infradead.org, Alexandre Torgue
 <alexandre.torgue@...s.st.com>, Jose Abreu <joabreu@...opsys.com>, Maxime
 Coquelin <mcoquelin.stm32@...il.com>, Simon Horman <horms@...nel.org>,
 linux-stm32@...md-mailman.stormreply.com, alexis.lothore@...tlin.com
Subject: Re: [PATCH net] net: stmmac: dwmac-socfpga: Don't access SGMII
 adapter when not available

Hi Andrew,

On Tue, 28 Nov 2023 17:37:30 +0100
Andrew Lunn <andrew@...n.ch> wrote:

> On Tue, Nov 28, 2023 at 10:45:37AM +0100, Maxime Chevallier wrote:
> > The SGMII adapter isn't present on all dwmac-socfpga implementations.
> > Make sure we don't try to configure it if we don't have this adapter.  
> 
> If it does not exist, why even try to call socfpga_sgmii_config()?
> 
> It seems like this test needs moving up the call stack. socfpga_gen5_set_phy_mode():
> 
> 	if (phymode == PHY_INTERFACE_MODE_SGMII)
> 		if (dwmac->sgmii_adapter_base)
> 			socfpga_sgmii_config(dwmac, true);
> 		else
> 			return -EINVAL;

I don't have access to a platform with the SGMII adapter available, but
my understanding is that we shouldn't error-out when we don't have the
adapter, as some other component (like the lynx PCS) might be there to
handle that mode.

However you have a valid point in that we might want to check if we
have either an SGMII adapter or a PCS, and if we have none of these we
error-out. Thanks for the suggestion, I'll address that :)

Maxime

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ