• Russell King's avatar
    net: phylink: fix link mode modification in PHY mode · d9922c0e
    Russell King authored
    Modifying the link settings via phylink_ethtool_ksettings_set() and
    phylink_ethtool_set_pauseparam() didn't always work as intended for
    PHY based setups, as calling phylink_mac_config() would result in the
    unresolved configuration being committed to the MAC, rather than the
    configuration with the speed and duplex setting.
    
    This would work fine if the update caused the link to renegotiate,
    but if no settings have changed, phylib won't trigger a renegotiation
    cycle, and the MAC will be left incorrectly configured.
    
    Avoid calling phylink_mac_config() unless we are using an inband mode
    in phylink_ethtool_ksettings_set(), and use phy_set_asym_pause() as
    introduced in 4.20 to set the PHY settings in
    phylink_ethtool_set_pauseparam().
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d9922c0e
phylink.c 49.4 KB