lkml.org 
[lkml]   [2023]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH net-next 7/8] net: phy: realtek: check validity of 10GbE link-partner advertisement
    Only use link-partner advertisement bits for 10GbE modes if they are
    actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes
    unless both of them are set.

    Signed-off-by: Daniel Golle <daniel@makrotopia.org>
    ---
    drivers/net/phy/realtek.c | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
    index cde61a30ac4c..29168f98f451 100644
    --- a/drivers/net/phy/realtek.c
    +++ b/drivers/net/phy/realtek.c
    @@ -715,6 +715,10 @@ static int rtl822x_read_status(struct phy_device *phydev)
    if (lpadv < 0)
    return lpadv;

    + if (!(lpadv & MDIO_AN_10GBT_STAT_REMOK) ||
    + !(lpadv & MDIO_AN_10GBT_STAT_LOCOK))
    + lpadv = 0;
    +
    mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, lpadv);
    }

    --
    2.40.0
    \
     
     \ /
      Last update: 2023-05-11 01:03    [W:6.072 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site