From: Camelia Groza Date: Tue, 24 Nov 2020 11:08:35 +0000 (+0200) Subject: sdk_dpaa: memac: fix AQR autoneg to lower than 10G partners X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~48 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=ac3c3de2ff287a31ea32e135ca889af339d3926d;p=linux.git sdk_dpaa: memac: fix AQR autoneg to lower than 10G partners Stop removing unsupported system side modes with AQR PHYs. Originally, their removal didn't impact the modes advertised by the PHY. Since auto-negotiation support was added to the aquantia driver, the unsupported modes were no longer advertised. This prohibited the PHY from negotiating with 1G link partners on LS1046ARDB. Patch adapted from similar fix for the upstream DPAA1 Ethernet driver: commit fddb5a50801a ("dpaa_eth: support all modes with rate adapting PHYs") Aquantia auto-negotiation: commit 09c4c57f7bc4 ("net: phy: aquantia: add support for auto-negotiation configuration") Signed-off-by: Camelia Groza --- diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c index d0dda69d3ffe..cf96d825f989 100644 --- a/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c @@ -496,6 +496,8 @@ static int xgmac_init_phy(struct net_device *net_dev, return 0; } +/* The Aquantia PHYs are capable of performing rate adaptation */ +#define PHY_VEND_AQUANTIA 0x03a1b400 static int memac_init_phy(struct net_device *net_dev, struct mac_device *mac_dev) { @@ -545,9 +547,15 @@ static int memac_init_phy(struct net_device *net_dev, return phy_dev == NULL ? -ENODEV : PTR_ERR(phy_dev); } - /* Remove any features not supported by the controller */ - ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support); - linkmode_and(phy_dev->supported, phy_dev->supported, mask); + /* Unless the PHY is capable of rate adaptation */ + if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII || + ((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) { + /* Remove any features not supported by the controller */ + ethtool_convert_legacy_u32_to_link_mode(mask, + mac_dev->if_support); + linkmode_and(phy_dev->supported, phy_dev->supported, mask); + } + /* Enable the symmetric and asymmetric PAUSE frame advertisements, * as most of the PHY drivers do not enable them by default. */