diff options
author | Doug Berger <opendmb@gmail.com> | 2017-03-21 17:01:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-30 03:41:22 -0400 |
commit | 2f94dd54cfe64a9f49e49c0856640c11fd1c9bc0 (patch) | |
tree | 05af8598ed598eeca7a8478aa88159f2041778b5 | |
parent | d80caeb9b86d2c8116776953ae3e3c0ddda364f1 (diff) |
net: bcmgenet: remove bcmgenet_internal_phy_setup()
[ Upstream commit 31739eae738ccbe8b9d627c3f2251017ca03f4d2 ]
Commit 6ac3ce8295e6 ("net: bcmgenet: Remove excessive PHY reset")
removed the bcmgenet_mii_reset() function from bcmgenet_power_up() and
bcmgenet_internal_phy_setup() functions. In so doing it broke the reset
of the internal PHY devices used by the GENETv1-GENETv3 which required
this reset before the UniMAC was enabled. It also broke the internal
GPHY devices used by the GENETv4 because the config_init that installed
the AFE workaround was no longer occurring after the reset of the GPHY
performed by bcmgenet_phy_power_set() in bcmgenet_internal_phy_setup().
In addition the code in bcmgenet_internal_phy_setup() related to the
"enable APD" comment goes with the bcmgenet_mii_reset() so it should
have also been removed.
Commit bd4060a6108b ("net: bcmgenet: Power on integrated GPHY in
bcmgenet_power_up()") moved the bcmgenet_phy_power_set() call to the
bcmgenet_power_up() function, but failed to remove it from the
bcmgenet_internal_phy_setup() function. Had it done so, the
bcmgenet_internal_phy_setup() function would have been empty and could
have been removed at that time.
Commit 5dbebbb44a6a ("net: bcmgenet: Software reset EPHY after power on")
was submitted to correct the functional problems introduced by
commit 6ac3ce8295e6 ("net: bcmgenet: Remove excessive PHY reset"). It
was included in v4.4 and made available on 4.3-stable. Unfortunately,
it didn't fully revert the commit because this bcmgenet_mii_reset()
doesn't apply the soft reset to the internal GPHY used by GENETv4 like
the previous one did. This prevents the restoration of the AFE work-
arounds for internal GPHY devices after the bcmgenet_phy_power_set() in
bcmgenet_internal_phy_setup().
This commit takes the alternate approach of removing the unnecessary
bcmgenet_internal_phy_setup() function which shouldn't have been in v4.3
so that when bcmgenet_mii_reset() was restored it should have only gone
into bcmgenet_power_up(). This will avoid the problems while also
removing the redundancy (and hopefully some of the confusion).
Fixes: 6ac3ce8295e6 ("net: bcmgenet: Remove excessive PHY reset")
Signed-off-by: Doug Berger <opendmb@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmmii.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index e87607621e62..2f9281936f0e 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c | |||
@@ -220,20 +220,6 @@ void bcmgenet_phy_power_set(struct net_device *dev, bool enable) | |||
220 | udelay(60); | 220 | udelay(60); |
221 | } | 221 | } |
222 | 222 | ||
223 | static void bcmgenet_internal_phy_setup(struct net_device *dev) | ||
224 | { | ||
225 | struct bcmgenet_priv *priv = netdev_priv(dev); | ||
226 | u32 reg; | ||
227 | |||
228 | /* Power up PHY */ | ||
229 | bcmgenet_phy_power_set(dev, true); | ||
230 | /* enable APD */ | ||
231 | reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); | ||
232 | reg |= EXT_PWR_DN_EN_LD; | ||
233 | bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT); | ||
234 | bcmgenet_mii_reset(dev); | ||
235 | } | ||
236 | |||
237 | static void bcmgenet_moca_phy_setup(struct bcmgenet_priv *priv) | 223 | static void bcmgenet_moca_phy_setup(struct bcmgenet_priv *priv) |
238 | { | 224 | { |
239 | u32 reg; | 225 | u32 reg; |
@@ -281,7 +267,6 @@ int bcmgenet_mii_config(struct net_device *dev) | |||
281 | 267 | ||
282 | if (priv->internal_phy) { | 268 | if (priv->internal_phy) { |
283 | phy_name = "internal PHY"; | 269 | phy_name = "internal PHY"; |
284 | bcmgenet_internal_phy_setup(dev); | ||
285 | } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { | 270 | } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { |
286 | phy_name = "MoCA"; | 271 | phy_name = "MoCA"; |
287 | bcmgenet_moca_phy_setup(priv); | 272 | bcmgenet_moca_phy_setup(priv); |