mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 23:20:32 -04:00
net: phylink: disable autoneg for interfaces that have no inband
Mathew reports that as a result of commit6561f0e547("net: pcs: pcs-lynx: implement pcs_inband_caps() method"), 10G SFP modules no longer work with the Lynx PCS. This problem is not specific to the Lynx PCS, but is caused by commitdf874f9e52("net: phylink: add pcs_inband_caps() method") which added validation of the autoneg state to the optical SFP configuration path. Fix this by handling interface modes that fundamentally have no inband negotiation more correctly - if we only have a single interface mode, clear the Autoneg support bit and the advertising mask. If the module can operate with several different interface modes, autoneg may be supported for other modes, so leave the support mask alone and just clear the Autoneg bit in the advertising mask. This restores 10G optical module functionality with PCS that supply their inband support, and makes ethtool output look sane. Reported-by: Mathew McBride <matt@traverse.com.au> Closes: https://lore.kernel.org/r/025c0ebe-5537-4fa3-b05a-8b835e5ad317@app.fastmail.com Fixes:df874f9e52("net: phylink: add pcs_inband_caps() method") Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/E1uslwx-00000001SPB-2kiM@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
1bd905dfea
commit
a21202743f
@@ -3634,6 +3634,7 @@ static int phylink_sfp_config_optical(struct phylink *pl)
|
||||
{
|
||||
__ETHTOOL_DECLARE_LINK_MODE_MASK(support);
|
||||
struct phylink_link_state config;
|
||||
enum inband_type inband_type;
|
||||
phy_interface_t interface;
|
||||
int ret;
|
||||
|
||||
@@ -3680,6 +3681,23 @@ static int phylink_sfp_config_optical(struct phylink *pl)
|
||||
phylink_dbg(pl, "optical SFP: chosen %s interface\n",
|
||||
phy_modes(interface));
|
||||
|
||||
inband_type = phylink_get_inband_type(interface);
|
||||
if (inband_type == INBAND_NONE) {
|
||||
/* If this is the sole interface, and there is no inband
|
||||
* support, clear the advertising mask and Autoneg bit in
|
||||
* the support mask. Otherwise, just clear the Autoneg bit
|
||||
* in the advertising mask.
|
||||
*/
|
||||
if (phy_interface_weight(pl->sfp_interfaces) == 1) {
|
||||
linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
|
||||
pl->sfp_support);
|
||||
linkmode_zero(config.advertising);
|
||||
} else {
|
||||
linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
|
||||
config.advertising);
|
||||
}
|
||||
}
|
||||
|
||||
if (!phylink_validate_pcs_inband_autoneg(pl, interface,
|
||||
config.advertising)) {
|
||||
phylink_err(pl, "autoneg setting not compatible with PCS");
|
||||
|
||||
Reference in New Issue
Block a user