]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: dsa: bcm_sf2: Turn on PHY to allow successful registration
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 6 Nov 2018 23:15:16 +0000 (15:15 -0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:03 +0000 (14:21 -0300)
BugLink: https://bugs.launchpad.net/bugs/1854975
[ Upstream commit c04a17d2a9ccf1eaba1c5a56f83e997540a70556 ]

We are binding to the PHY using the SF2 slave MDIO bus that we create,
binding involves reading the PHY's MII_PHYSID1/2 which won't be possible
if the PHY is turned off. Temporarily turn it on/off for the bus probing
to succeeed. This fixes unbind/bind problems where the port connecting
to that PHY would be in error since it could not connect to it.

Signed-off-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: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/dsa/bcm_sf2.c

index 6ae96dda9e5b5b403e661f77784cbbf5afdcca8a..2aac4073b0308e8470e83c1fe83dd500dfa90f56 100644 (file)
@@ -1051,12 +1051,16 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
                return ret;
        }
 
+       bcm_sf2_gphy_enable_set(priv->dev->ds, true);
+
        ret = bcm_sf2_mdio_register(ds);
        if (ret) {
                pr_err("failed to register MDIO bus\n");
                return ret;
        }
 
+       bcm_sf2_gphy_enable_set(priv->dev->ds, false);
+
        ret = bcm_sf2_cfp_rst(priv);
        if (ret) {
                pr_err("failed to reset CFP\n");