[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170310004906.10553-5-opendmb@gmail.com>
Date: Thu, 9 Mar 2017 16:49:02 -0800
From: Doug Berger <opendmb@...il.com>
To: f.fainelli@...il.com
Cc: pgynther@...gle.com, jaedon.shin@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Doug Berger <doug.berger@...adcom.com>
Subject: [PATCH net 4/8] net: bcmgenet: power down internal phy if open or resume fails
From: Doug Berger <doug.berger@...adcom.com>
Since the internal PHY is powered up during the open and resume
functions it should be powered back down if the functions fail.
refs #SWLINUX-4311
Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Doug Berger <doug.berger@...adcom.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 99f8d9024633..475dc14931af 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2850,6 +2850,8 @@ static int bcmgenet_open(struct net_device *dev)
err_fini_dma:
bcmgenet_fini_dma(priv);
err_clk_disable:
+ if (priv->internal_phy)
+ bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
clk_disable_unprepare(priv->clk);
return ret;
}
@@ -3551,6 +3553,8 @@ static int bcmgenet_resume(struct device *d)
return 0;
out_clk_disable:
+ if (priv->internal_phy)
+ bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
clk_disable_unprepare(priv->clk);
return ret;
}
--
2.11.1
Powered by blists - more mailing lists