Commit 1b451fb2 authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

net: mvpp2: fix the phylink mode validation

The mvpp2_phylink_validate() sets all modes that are supported by a
given PPv2 port. An mistake made the 10000baseT_Full mode being
advertised in some cases when a port wasn't configured to perform at
10G. This patch fixes this.

Fixes: d97c9f4a ("net: mvpp2: 1000baseX support")
Reported-by: default avatarRussell King <linux@armlinux.org.uk>
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 599d2570
...@@ -4406,6 +4406,7 @@ static void mvpp2_phylink_validate(struct net_device *dev, ...@@ -4406,6 +4406,7 @@ static void mvpp2_phylink_validate(struct net_device *dev,
case PHY_INTERFACE_MODE_XAUI: case PHY_INTERFACE_MODE_XAUI:
case PHY_INTERFACE_MODE_NA: case PHY_INTERFACE_MODE_NA:
if (port->gop_id == 0) { if (port->gop_id == 0) {
phylink_set(mask, 10000baseT_Full);
phylink_set(mask, 10000baseCR_Full); phylink_set(mask, 10000baseCR_Full);
phylink_set(mask, 10000baseSR_Full); phylink_set(mask, 10000baseSR_Full);
phylink_set(mask, 10000baseLR_Full); phylink_set(mask, 10000baseLR_Full);
...@@ -4423,7 +4424,6 @@ static void mvpp2_phylink_validate(struct net_device *dev, ...@@ -4423,7 +4424,6 @@ static void mvpp2_phylink_validate(struct net_device *dev,
phylink_set(mask, 10baseT_Full); phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Half); phylink_set(mask, 100baseT_Half);
phylink_set(mask, 100baseT_Full); phylink_set(mask, 100baseT_Full);
phylink_set(mask, 10000baseT_Full);
/* Fall-through */ /* Fall-through */
case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_2500BASEX: case PHY_INTERFACE_MODE_2500BASEX:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment