Skip to content

Commit

Permalink
net: bcmgenet: power down and up GPHY during suspend/resume
Browse files Browse the repository at this point in the history
In case the interface is not used, power down the integrated GPHY during
suspend. Similarly to bcmgenet_open(), bcmgenet_resume() powers on the GPHY
prior to any UniMAC activity.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Mar 24, 2015
1 parent a642c4f commit a6f31f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/broadcom/genet/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3107,6 +3107,8 @@ static int bcmgenet_suspend(struct device *d)
if (device_may_wakeup(d) && priv->wolopts) {
ret = bcmgenet_power_down(priv, GENET_POWER_WOL_MAGIC);
clk_prepare_enable(priv->clk_wol);
} else if (phy_is_internal(priv->phydev)) {
ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
}

/* Turn off the clocks */
Expand All @@ -3131,6 +3133,12 @@ static int bcmgenet_resume(struct device *d)
if (ret)
return ret;

/* If this is an internal GPHY, power it back on now, before UniMAC is
* brought out of reset as absolutely no UniMAC activity is allowed
*/
if (phy_is_internal(priv->phydev))
bcmgenet_power_up(priv, GENET_POWER_PASSIVE);

bcmgenet_umac_reset(priv);

ret = init_umac(priv);
Expand Down

0 comments on commit a6f31f5

Please sign in to comment.