summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
diff options
context:
space:
mode:
authorBaruch Siach2018-12-04 15:03:52 +0100
committerDavid S. Miller2018-12-05 06:17:15 +0100
commit01b3fd5ac97caffb8e5d5bd85086da33db3b361f (patch)
tree597595caca1a7b9c870e84c1f0ff72df377ab67d /drivers/net/ethernet/marvell
parentethernet: fman: fix wrong of_node_put() in probe function (diff)
downloadkernel-qcow2-linux-01b3fd5ac97caffb8e5d5bd85086da33db3b361f.tar.gz
kernel-qcow2-linux-01b3fd5ac97caffb8e5d5bd85086da33db3b361f.tar.xz
kernel-qcow2-linux-01b3fd5ac97caffb8e5d5bd85086da33db3b361f.zip
net: mvpp2: fix detection of 10G SFP modules
The mvpp2_phylink_validate() relies on the interface field of phylink_link_state to determine valid link modes. However, when called from phylink_sfp_module_insert() this field in not initialized. The default switch case then excludes 10G link modes. This allows 10G SFP modules that are detected correctly to be configured at max rate of 2.5G. Catch the uninitialized PHY mode case, and allow 10G rates. Fixes: d97c9f4ab000b ("net: mvpp2: 1000baseX support") Cc: Maxime Chevallier <maxime.chevallier@bootlin.com> Cc: Antoine Tenart <antoine.tenart@bootlin.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r--drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 7a37a37e3fb3..eb1dc8abc359 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -4384,6 +4384,7 @@ static void mvpp2_phylink_validate(struct net_device *dev,
switch (state->interface) {
case PHY_INTERFACE_MODE_10GKR:
+ case PHY_INTERFACE_MODE_NA:
phylink_set(mask, 10000baseCR_Full);
phylink_set(mask, 10000baseSR_Full);
phylink_set(mask, 10000baseLR_Full);