Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 09c4c57f7bc4 ("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 <ykaukab@suse.de>
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Madalin Bucur and committed by
David S. Miller
73a21fa8 259039fa

+11 -3
+11 -3
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
··· 2453 2453 mac_dev->adjust_link(mac_dev); 2454 2454 } 2455 2455 2456 + /* The Aquantia PHYs are capable of performing rate adaptation */ 2457 + #define PHY_VEND_AQUANTIA 0x03a1b400 2458 + 2456 2459 static int dpaa_phy_init(struct net_device *net_dev) 2457 2460 { 2458 2461 __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; ··· 2474 2471 return -ENODEV; 2475 2472 } 2476 2473 2477 - /* Remove any features not supported by the controller */ 2478 - ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support); 2479 - linkmode_and(phy_dev->supported, phy_dev->supported, mask); 2474 + /* Unless the PHY is capable of rate adaptation */ 2475 + if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII || 2476 + ((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) { 2477 + /* remove any features not supported by the controller */ 2478 + ethtool_convert_legacy_u32_to_link_mode(mask, 2479 + mac_dev->if_support); 2480 + linkmode_and(phy_dev->supported, phy_dev->supported, mask); 2481 + } 2480 2482 2481 2483 phy_support_asym_pause(phy_dev); 2482 2484