]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: mvpp2: fix validate for PPv2.1
authorAntoine Tenart <antoine.tenart@bootlin.com>
Fri, 1 Mar 2019 10:52:08 +0000 (11:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Mar 2019 07:23:34 +0000 (23:23 -0800)
The Phylink validate function is the Marvell PPv2 driver makes a check
on the GoP id. This is valid an has to be done when using PPv2.2 engines
but makes no sense when using PPv2.1. The check done when using an RGMII
interface makes sure the GoP id is not 0, but this breaks PPv2.1. Fixes
it.

Fixes: 0fb628f0f250 ("net: mvpp2: fix phylink handling of invalid PHY modes")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index 9467a2258ee0d76db45f5225c41d98306cabd934..e7d768381f4fe674baf8ba77a4f5947f9a1a629b 100644 (file)
@@ -4363,7 +4363,7 @@ static void mvpp2_phylink_validate(struct net_device *dev,
        case PHY_INTERFACE_MODE_RGMII_ID:
        case PHY_INTERFACE_MODE_RGMII_RXID:
        case PHY_INTERFACE_MODE_RGMII_TXID:
-               if (port->gop_id == 0)
+               if (port->priv->hw_version == MVPP22 && port->gop_id == 0)
                        goto empty_set;
                break;
        default: