]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: bcmgenet: Fix speed selection for reverse MII
authorAndrew Lunn <andrew@lunn.ch>
Tue, 11 Sep 2018 23:53:12 +0000 (01:53 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:17:01 +0000 (13:17 +0100)
BugLink: https://bugs.launchpad.net/bugs/1853915
[ Upstream commit 00eb2243b933a496958f4ce1bcf59840fea8be16 ]

The phy supported speed is being used to determine if the MAC should
be configured to 100 or 1G. The masking logic is broken. Instead, look
at 1G supported speeds to enable 1G MAC support.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/broadcom/genet/bcmmii.c

index 0d527fa5de610c26586ccc33dae468e2e43d2289..b0592fd4135b305da9c872ea7f4e77fd44735fca 100644 (file)
@@ -226,11 +226,10 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)
                 * capabilities, use that knowledge to also configure the
                 * Reverse MII interface correctly.
                 */
-               if ((dev->phydev->supported & PHY_BASIC_FEATURES) ==
-                               PHY_BASIC_FEATURES)
-                       port_ctrl = PORT_MODE_EXT_RVMII_25;
-               else
+               if (dev->phydev->supported & PHY_1000BT_FEATURES)
                        port_ctrl = PORT_MODE_EXT_RVMII_50;
+               else
+                       port_ctrl = PORT_MODE_EXT_RVMII_25;
                bcmgenet_sys_writel(priv, port_ctrl, SYS_PORT_CTRL);
                break;