• Russell King's avatar
    net: phylink: extend clause 45 PHY validation workaround · df3f57ac
    Russell King authored
    Commit e45d1f52 ("net: phylink: support Clause 45 PHYs on SFP+
    modules") added a workaround to support clause 45 PHYs which
    dynamically switch their interface mode on SFP+ modules.  This was
    implemented by validating the PHYs supported/advertising using
    PHY_INTERFACE_MODE_NA, rather than the specific interface mode that
    we attached the PHY with.
    
    However, we already have a situation where phylink is used to connect
    a Marvell 88X3310 PHY which also behaves in exactly the same way, but
    which seemingly doesn't need this.  The reason seems to be that the
    mvpp2 driver sets a whole bunch of link modes for
    PHY_INTERFACE_MODE_10GKR down to 10Mb/s, despite 10GBASE-R not actually
    supporting anything but 10Gb/s speeds.
    
    When testing with drivers that (correctly) take the mvneta approach,
    where the validate() method only returns what can be supported /
    advertised for the specified link mode, we find that Clause 45 PHYs do
    not behave as we expect: their advertisement is restricted to what
    the current link will support, rather than what the PHY supports
    through its dynamic switching.
    
    Extend this workaround to all such cases; if we have a Clause 45 PHY
    attaching via any means, except in USXGMII, XAUI and RXAUI which are
    all unable to support this dynamic switching or have other solutions
    to it, then we need to validate using PHY_INTERFACE_MODE_NA.
    
    This should allow mvpp2 to switch to a more conformant validate()
    implementation.
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    df3f57ac
phylink.c 52.6 KB