Before disconnecting the PHY when a port is being taken down,
a call to phy_stop() is necessary.

Signed-off-by: Steven J. Hill <steven.h...@cavium.com>
Acked-by: David Daney <david.da...@cavium.com>
---
 drivers/staging/octeon/ethernet-mdio.c | 4 +++-
 drivers/staging/octeon/ethernet.c      | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-mdio.c 
b/drivers/staging/octeon/ethernet-mdio.c
index 691e4a5..b9d67c9 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -124,8 +124,10 @@ int cvm_oct_common_stop(struct net_device *dev)
 
        priv->poll = NULL;
 
-       if (dev->phydev)
+       if (dev->phydev) {
+               phy_stop(dev->phydev);
                phy_disconnect(dev->phydev);
+       }
 
        if (priv->last_link) {
                link_info.u64 = 0;
diff --git a/drivers/staging/octeon/ethernet.c 
b/drivers/staging/octeon/ethernet.c
index 429e24a..53d961d 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -463,8 +463,10 @@ int cvm_oct_common_init(struct net_device *dev)
 
 void cvm_oct_common_uninit(struct net_device *dev)
 {
-       if (dev->phydev)
+       if (dev->phydev) {
+               phy_stop(dev->phydev);
                phy_disconnect(dev->phydev);
+       }
 }
 
 int cvm_oct_common_open(struct net_device *dev,
-- 
2.1.4

Reply via email to