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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z3ZXmAIAHmYVbdbl@shell.armlinux.org.uk>
Date: Thu, 2 Jan 2025 09:08:40 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
	Jose Abreu <joabreu@...opsys.com>,
	Andrew Lunn <andrew+netdev@...n.ch>, davem@...emloft.net,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Maxime Coquelin <mcoquelin.stm32@...il.com>,
	Alexis Lothoré <alexis.lothore@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 5/5] net: stmmac: use PCS supported_interfaces

On Tue, Dec 17, 2024 at 02:19:12PM +0100, Maxime Chevallier wrote:
> Hi Russell,
> 
> On Fri, 13 Dec 2024 19:35:12 +0000
> "Russell King (Oracle)" <rmk+kernel@...linux.org.uk> wrote:
> 
> > Use the PCS' supported_interfaces member to build the MAC level
> > supported_interfaces bitmap.
> > 
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++++++--
> >  1 file changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index d45fd7a3acd5..0e45c4a48bb5 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > @@ -1206,6 +1206,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
> >  	struct stmmac_mdio_bus_data *mdio_bus_data;
> >  	int mode = priv->plat->phy_interface;
> >  	struct fwnode_handle *fwnode;
> > +	struct phylink_pcs *pcs;
> >  	struct phylink *phylink;
> >  
> >  	priv->phylink_config.dev = &priv->dev->dev;
> > @@ -1227,8 +1228,14 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
> >  
> >  	/* If we have an xpcs, it defines which PHY interfaces are supported. */
> >  	if (priv->hw->xpcs)
> > -		xpcs_get_interfaces(priv->hw->xpcs,
> > -				    priv->phylink_config.supported_interfaces);
> > +		pcs = xpcs_to_phylink_pcs(priv->hw->xpcs);
> > +	else
> > +		pcs = priv->hw->phylink_pcs;
> > +
> > +	if (pcs)
> > +		phy_interface_or(priv->phylink_config.supported_interfaces,
> > +				 priv->phylink_config.supported_interfaces,
> > +				 pcs->supported_interfaces);
> >  
> >  	fwnode = priv->plat->port_node;
> >  	if (!fwnode)
> 
> I think that we could even make xpcs_get_interfaces a static
> non-exported function now :) But this can be done in a subsequent patch.

Yes, that can definitely be done. I already have a patch for this.

Thanks.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ