netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Antoine Tenart <antoine.tenart@bootlin.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] net: mvpp2: update mvpp2 validate() implementation
Date: Fri, 13 Dec 2019 17:51:54 +0100	[thread overview]
Message-ID: <20191213165154.GC26710@kwain> (raw)
In-Reply-To: <20191213164028.GV25745@shell.armlinux.org.uk>

On Fri, Dec 13, 2019 at 04:40:28PM +0000, Russell King - ARM Linux admin wrote:
> On Fri, Dec 13, 2019 at 05:28:08PM +0100, Antoine Tenart wrote:
> > On Fri, Dec 13, 2019 at 04:11:44PM +0000, Russell King - ARM Linux admin wrote:
> > > On Fri, Dec 13, 2019 at 05:04:20PM +0100, Antoine Tenart wrote:
> > > > On Thu, Dec 12, 2019 at 05:43:46PM +0000, Russell King wrote:
> > > > > 
> > > > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> > > > > index 111b3b8239e1..fddd856338b4 100644
> > > > > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> > > > > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> > > > > @@ -4786,6 +4786,8 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
> > > > >  			phylink_set(mask, 10000baseER_Full);
> > > > >  			phylink_set(mask, 10000baseKR_Full);
> > > > >  		}
> > > > > +		if (state->interface != PHY_INTERFACE_MODE_NA)
> > > > > +			break;
> > > > 
> > > > >  		/* Fall-through */
> > > > >  	case PHY_INTERFACE_MODE_RGMII:
> > > > >  	case PHY_INTERFACE_MODE_RGMII_ID:
> > > > > @@ -4796,13 +4798,21 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
> > > > >  		phylink_set(mask, 10baseT_Full);
> > > > >  		phylink_set(mask, 100baseT_Half);
> > > > >  		phylink_set(mask, 100baseT_Full);
> > > > > +		if (state->interface != PHY_INTERFACE_MODE_NA)
> > > > > +			break;
> > > > 
> > > > The two checks above will break the 10G/1G interfaces on the mcbin
> > > > (eth0/eth1) as they can support both 10gbase-kr and 10/100/1000baseT
> > > > modes depending on what's connected. With this patch only the modes
> > > > related to the one defined in the device tree would be valid, breaking
> > > > run-time reconfiguration of the link.
> > > 
> > > Exactly which scenario are you talking about?  The mcbin doubleshot
> > > setup, or the singleshot setup?
> > 
> > I was thinking about the doubleshot.
> > 
> > > This patch (when combined with the others) has no effect on the
> > > doubleshot, and should have no effect on the SFP cages on the single
> > > shot.
> > 
> > You're right, I just tested the series and it the two 10G/1G ports were
> > able to be reconfigured at runtime, my bad.
> > 
> > However it seems cp1_eth1 is coming up at 100Mbps only. (I haven't
> > looked into it more than a quick test so far).
> 
> Oh, looks like I made a mistake in the fallthrough for *GMII modes.
> It's probably easier just to add the two 1G modes there, which
> should restore eth2 to full functionality.  Thanks for spotting.
> 
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index fddd856338b4..f09fcbe6ea88 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -4798,6 +4798,8 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
>  		phylink_set(mask, 10baseT_Full);
>  		phylink_set(mask, 100baseT_Half);
>  		phylink_set(mask, 100baseT_Full);
> +		phylink_set(mask, 1000baseT_Full);
> +		phylink_set(mask, 1000baseX_Full);
>  		if (state->interface != PHY_INTERFACE_MODE_NA)
>  			break;
>  		/* Fall-through */

Agreed, adding the two 1G modes here is easier and more readable.

Thanks,
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2019-12-13 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 17:43 [PATCH net-next 0/3] improve clause 45 support in phylink Russell King - ARM Linux admin
2019-12-12 17:43 ` [PATCH net-next 1/3] net: phylink: improve clause 45 PHY ksettings_set implementation Russell King
2019-12-12 17:43 ` [PATCH net-next 2/3] net: phylink: extend clause 45 PHY validation workaround Russell King
2019-12-12 17:43 ` [PATCH net-next 3/3] net: mvpp2: update mvpp2 validate() implementation Russell King
2019-12-13 16:04   ` Antoine Tenart
2019-12-13 16:11     ` Russell King - ARM Linux admin
2019-12-13 16:28       ` Antoine Tenart
2019-12-13 16:40         ` Russell King - ARM Linux admin
2019-12-13 16:51           ` Antoine Tenart [this message]

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=20191213165154.GC26710@kwain \
    --to=antoine.tenart@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux@armlinux.org.uk \
    --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 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).