netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, pavana.sharma@digi.com,
	vivien.didelot@gmail.com, f.fainelli@gmail.com, kuba@kernel.org,
	lkp@intel.com, davem@davemloft.net, ashkan.boldaji@digi.com,
	Chris Packham <chris.packham@alliedtelesis.co.nz>,
	olteanv@gmail.com,
	Russell King - ARM Linux admin <linux@armlinux.org.uk>,
	Russell King <rmk+kernel@armlinux.org.uk>
Subject: Re: [PATCH net] net: dsa: mv88e6xxx: do not allow inband AN for 2500base-x mode
Date: Fri, 15 Jan 2021 00:55:16 +0100	[thread overview]
Message-ID: <20210115005516.03f0f772@kernel.org> (raw)
In-Reply-To: <YADNEWkiPQX34Tyo@lunn.ch>

On Fri, 15 Jan 2021 00:00:33 +0100
Andrew Lunn <andrew@lunn.ch> wrote:

> > diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c
> > index 3195936dc5be..b8241820679e 100644
> > --- a/drivers/net/dsa/mv88e6xxx/serdes.c
> > +++ b/drivers/net/dsa/mv88e6xxx/serdes.c
> > @@ -55,9 +55,20 @@ static int mv88e6xxx_serdes_pcs_get_state(struct mv88e6xxx_chip *chip,
> >  {
> >  	if (status & MV88E6390_SGMII_PHY_STATUS_SPD_DPL_VALID) {
> >  		state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK);
> > +
> > +		if (state->interface == PHY_INTERFACE_MODE_2500BASEX) {
> > +			if (state->link) {
> > +				state->speed = SPEED_2500;
> > +				state->duplex = DUPLEX_FULL;
> > +			}
> > +
> > +			return 0;
> > +		}
> > +
> > +		state->an_complete = 1;  
> 
> Should this be here? It seems like a logically different change, it is
> not clear to me it is to do with PHY_INTERFACE_MODE_2500BASEX.

This function does not set an_complete at all, and as I understand it,
it should. But maybe this should be in different commit, and more
thought put into it. I will rethink it and send another version.

> >  		state->duplex = status &
> >  				MV88E6390_SGMII_PHY_STATUS_DUPLEX_FULL ?
> > -			                         DUPLEX_FULL : DUPLEX_HALF;
> > +						DUPLEX_FULL : DUPLEX_HALF;  
> 
> This looks like an unintended white space change.

This change is intended. There were 17 space there istead of 2 tabs + 1
space. And the last space is not needed, since it does not provide any
other alignment. Should this be in separate commit?

BTW Andrew, the code in serdes.c does many read and write calls, and it
could be simplified a lot by implementing modify, setbits and clearbits
methods, like phy.h implements. Or maybe we can use phy_mmd_* methods
here instead of mv88e6390_serdes_read/write ?

I fear such change will make future backporting of new fix commits
a pain. But I still think it should be done. What do you think?

Marek

  reply	other threads:[~2021-01-14 23:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  2:40 [PATCH net] net: dsa: mv88e6xxx: do not allow inband AN for 2500base-x mode Marek Behún
2021-01-14 23:00 ` Andrew Lunn
2021-01-14 23:55   ` Marek Behún [this message]
2021-01-15 14:16     ` Andrew Lunn

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=20210115005516.03f0f772@kernel.org \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ashkan.boldaji@digi.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pavana.sharma@digi.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=vivien.didelot@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).