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]
Date: Tue, 26 Sep 2023 15:09:47 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>, netdev@...r.kernel.org, 
	davem@...emloft.net, Jose.Abreu@...opsys.com, hkallweit1@...il.com, 
	UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next] net: pcs: xpcs: Add 2500BASE-X case in get
 state for XPCS drivers

Hi Russell

On Tue, Sep 26, 2023 at 12:45:47PM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 26, 2023 at 02:39:21PM +0300, Serge Semin wrote:
> > Hi Raju
> > 
> > On Mon, Sep 25, 2023 at 01:21:42PM +0530, Raju Lakkaraju wrote:
> > > Add DW_2500BASEX case in xpcs_get_state( ) to update speed, duplex and pause
> > > Update the port mode and autonegotiation
> > > 
> > > Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
> > > ---
> > >  drivers/net/pcs/pcs-xpcs.c | 31 +++++++++++++++++++++++++++++++
> > >  drivers/net/pcs/pcs-xpcs.h |  4 ++++
> > >  2 files changed, 35 insertions(+)
> > > 
> > > diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
> > > index 4dbc21f604f2..4f89dcedf0fc 100644
> > > --- a/drivers/net/pcs/pcs-xpcs.c
> > > +++ b/drivers/net/pcs/pcs-xpcs.c
> > > @@ -1090,6 +1090,30 @@ static int xpcs_get_state_c37_1000basex(struct dw_xpcs *xpcs,
> > >  	return 0;
> > >  }
> > >  
> > > +static int xpcs_get_state_2500basex(struct dw_xpcs *xpcs,
> > > +				    struct phylink_link_state *state)
> > > +{
> > > +	int sts, lpa;
> > > +
> > > +	sts = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_STS);
> > 
> > > +	lpa = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_LP_BABL);
> > > +	if (sts < 0 || lpa < 0) {
> > > +		state->link = false;
> > > +		return sts;
> > > +	}
> > 
> > The HW manual says: "The host uses this page to know the link
> > partner's ability when the base page is received through Clause 37
> > auto-negotiation." Seeing xpcs_config_2500basex() disables
> > auto-negotiation and lpa value is unused anyway why do you even need
> > to read the LP_BABL register?
> 

> Since you have access to the hardware manual, what does it say about
> clause 37 auto-negotiation when operating in 2500base-X mode?

Here are the parts which mention 37 & SGMII AN in the 2.5G context:

1. "Clause 37 (& SGMII) auto-negotiation is supported in 2.5G mode if
    the link partner is also operating in the equivalent 2.5G mode."

2. "During the Clause 37/SGMII as the auto-negotiation link timer
    operates with a faster clock in the 2.5G mode, the timeout duration
    reduces by a factor of 2.5. To restore the standard specified timeout
    period, the respective registers must be re-programmed."

I guess the entire 2.5G-thing understanding could be generalized by
the next sentence from the HW manual: "The 2.5G mode of operation is
functionally the same as 1000BASE-X/KX mode, except that the
clock-rate is 2.5 times the original rate. In this mode, the
Serdes/PHY operates at a serial baud-rate of 3.125 Gbps and DWC_xpcs
data-path and the GMII interface to MAC operates at 312.5 MHz (instead
of 125 MHz)." Thus here is another info regarding AN in that context:

3. "The DWC_xpcs operates either in 10/100/1000Mbps rate or
25/250/2500Mbps rates respectively with SGMII auto-negotiation. The
DWC_xpcs cannot support switching or negotiation between 1G and 2.5G
rates using auto-negotiation."

-Serge(y)

> 
> 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