Skip to content

Commit f63d2b8

Browse files
hkallweitsmb49
authored andcommitted
net: ethernet: xgbe: re-add aneg to supported features in PHY quirks
BugLink: https://bugs.launchpad.net/bugs/2107449 commit 6be7aca91009865d8c2b73589270224a6b6e67ab upstream. In 4.19, before the switch to linkmode bitmaps, PHY_GBIT_FEATURES included feature bits for aneg and TP/MII ports. SUPPORTED_TP | \ SUPPORTED_MII) SUPPORTED_10baseT_Full) SUPPORTED_100baseT_Full) SUPPORTED_1000baseT_Full) PHY_100BT_FEATURES | \ PHY_DEFAULT_FEATURES) PHY_1000BT_FEATURES) Referenced commit expanded PHY_GBIT_FEATURES, silently removing PHY_DEFAULT_FEATURES. The removed part can be re-added by using the new PHY_GBIT_FEATURES definition. Not clear to me is why nobody seems to have noticed this issue. I stumbled across this when checking what it takes to make phy_10_100_features_array et al private to phylib. Fixes: d0939c2 ("net: ethernet: xgbe: expand PHY_GBIT_FEAUTRES") Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/46521973-7738-4157-9f5e-0bb6f694acba@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Koichiro Den <koichiro.den@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 3953fde commit f63d2b8

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)
923923

924924
static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
925925
{
926-
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
927926
struct xgbe_phy_data *phy_data = pdata->phy_data;
928927
unsigned int phy_id = phy_data->phydev->phy_id;
929928

@@ -945,14 +944,7 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
945944
phy_write(phy_data->phydev, 0x04, 0x0d01);
946945
phy_write(phy_data->phydev, 0x00, 0x9140);
947946

948-
linkmode_set_bit_array(phy_10_100_features_array,
949-
ARRAY_SIZE(phy_10_100_features_array),
950-
supported);
951-
linkmode_set_bit_array(phy_gbit_features_array,
952-
ARRAY_SIZE(phy_gbit_features_array),
953-
supported);
954-
955-
linkmode_copy(phy_data->phydev->supported, supported);
947+
linkmode_copy(phy_data->phydev->supported, PHY_GBIT_FEATURES);
956948

957949
phy_support_asym_pause(phy_data->phydev);
958950

@@ -964,7 +956,6 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
964956

965957
static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
966958
{
967-
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
968959
struct xgbe_phy_data *phy_data = pdata->phy_data;
969960
struct xgbe_sfp_eeprom *sfp_eeprom = &phy_data->sfp_eeprom;
970961
unsigned int phy_id = phy_data->phydev->phy_id;
@@ -1028,13 +1019,7 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
10281019
reg = phy_read(phy_data->phydev, 0x00);
10291020
phy_write(phy_data->phydev, 0x00, reg & ~0x00800);
10301021

1031-
linkmode_set_bit_array(phy_10_100_features_array,
1032-
ARRAY_SIZE(phy_10_100_features_array),
1033-
supported);
1034-
linkmode_set_bit_array(phy_gbit_features_array,
1035-
ARRAY_SIZE(phy_gbit_features_array),
1036-
supported);
1037-
linkmode_copy(phy_data->phydev->supported, supported);
1022+
linkmode_copy(phy_data->phydev->supported, PHY_GBIT_FEATURES);
10381023
phy_support_asym_pause(phy_data->phydev);
10391024

10401025
netif_dbg(pdata, drv, pdata->netdev,

0 commit comments

Comments
 (0)