]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvpp2: fix detection of 10G SFP modules
authorBaruch Siach <baruch@tkos.co.il>
Tue, 4 Dec 2018 14:03:52 +0000 (16:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Dec 2018 05:17:15 +0000 (21:17 -0800)
commitecc1e3050f49ac7617e172942307a44e06bbd2bb
tree597595caca1a7b9c870e84c1f0ff72df377ab67d
parentbe96542c3b5615bd64d11b0769f60a5953f8a076
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: b26d9538e28fa ("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>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c