]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:40:27 +0000 (19:40 +0200)
[ Upstream commit 8b318f30ab4ef9bbc1241e6f8c1db366dbd347f2 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index 931beac3359d1854ff4d469ec8b18b0a698311e5..70031e2b22944b94ba2232f8d1694e739d046712 100644 (file)
@@ -4370,7 +4370,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: