All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	Jose.Abreu@synopsys.com, hkallweit1@gmail.com,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next] net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers
Date: Tue, 26 Sep 2023 12:45:47 +0100	[thread overview]
Message-ID: <ZRLEazyb0yS1Oxft@shell.armlinux.org.uk> (raw)
In-Reply-To: <fbkzmsznag5yjypbzmbmvtzfgdgx3v4pc6njmelrz3x7pvlojq@rh3tqyo5sr26>

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@microchip.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?

Thanks.

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

  reply	other threads:[~2023-09-26 11:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25  7:51 [PATCH net-next] net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers Raju Lakkaraju
2023-09-26 11:39 ` Serge Semin
2023-09-26 11:45   ` Russell King (Oracle) [this message]
2023-09-26 12:09     ` Serge Semin
2023-09-26 14:46       ` Russell King (Oracle)
2023-09-26 15:27         ` Serge Semin
2023-09-26 15:47           ` Russell King (Oracle)
2023-09-26 19:40             ` Serge Semin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZRLEazyb0yS1Oxft@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Jose.Abreu@synopsys.com \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=fancer.lancer@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.