Skip to content

Commit 73a21fa

Browse files
madalinbucurdavem330
authored andcommitted
dpaa_eth: support all modes with rate adapting PHYs
Stop removing modes that are not supported on the system interface when the connected PHY is capable of rate adaptation. This addresses an issue with the LS1046ARDB board 10G interface no longer working with an 1G link partner after autonegotiation support was added for the Aquantia PHY on board in commit 09c4c57 ("net: phy: aquantia: add support for auto-negotiation configuration") Before this commit the values advertised by the PHY were not influenced by the dpaa_eth driver removal of system-side unsupported modes as the aqr_config_aneg() was basically a no-op. After this commit, the modes removed by the dpaa_eth driver were no longer advertised thus autonegotiation with 1G link partners failed. Reported-by: Mian Yousaf Kaukab <[email protected]> Signed-off-by: Madalin Bucur <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 259039f commit 73a21fa

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,9 @@ static void dpaa_adjust_link(struct net_device *net_dev)
24532453
mac_dev->adjust_link(mac_dev);
24542454
}
24552455

2456+
/* The Aquantia PHYs are capable of performing rate adaptation */
2457+
#define PHY_VEND_AQUANTIA 0x03a1b400
2458+
24562459
static int dpaa_phy_init(struct net_device *net_dev)
24572460
{
24582461
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
@@ -2471,9 +2474,14 @@ static int dpaa_phy_init(struct net_device *net_dev)
24712474
return -ENODEV;
24722475
}
24732476

2474-
/* Remove any features not supported by the controller */
2475-
ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support);
2476-
linkmode_and(phy_dev->supported, phy_dev->supported, mask);
2477+
/* Unless the PHY is capable of rate adaptation */
2478+
if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII ||
2479+
((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) {
2480+
/* remove any features not supported by the controller */
2481+
ethtool_convert_legacy_u32_to_link_mode(mask,
2482+
mac_dev->if_support);
2483+
linkmode_and(phy_dev->supported, phy_dev->supported, mask);
2484+
}
24772485

24782486
phy_support_asym_pause(phy_dev);
24792487

0 commit comments

Comments
 (0)