Skip to content

Commit

Permalink
net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G
Browse files Browse the repository at this point in the history
Some Marvell Alaska PHYs support 2.5G, 5G and 10G BaseT links. Their
default behaviour is to advertise all of these modes, but at the moment,
only 10GBaseT is supported. To prevent link partners from establishing
link at that speed, clear these modes upon configuring aneg parameters.

Fixes: 20b2af3 ("net: phy: add Marvell Alaska X 88X3310 10Gigabit PHY support")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reported-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maxime Chevallier authored and David S. Miller committed Feb 23, 2019
1 parent ea34a00 commit 61a65d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/phy/marvell10g.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <linux/marvell_phy.h>
#include <linux/phy.h>

#define MDIO_AN_10GBT_CTRL_ADV_NBT_MASK 0x01e0

enum {
MV_PCS_BASE_T = 0x0000,
MV_PCS_BASE_R = 0x1000,
Expand Down Expand Up @@ -386,8 +388,10 @@ static int mv3310_config_aneg(struct phy_device *phydev)
else
reg = 0;

/* Make sure we clear unsupported 2.5G/5G advertising */
ret = mv3310_modify(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
MDIO_AN_10GBT_CTRL_ADV10G, reg);
MDIO_AN_10GBT_CTRL_ADV10G |
MDIO_AN_10GBT_CTRL_ADV_NBT_MASK, reg);
if (ret < 0)
return ret;
if (ret > 0)
Expand Down

0 comments on commit 61a65d3

Please sign in to comment.