summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/cpsw.c
diff options
context:
space:
mode:
authorGrygorii Strashko2016-06-24 20:23:41 +0200
committerDavid S. Miller2016-06-28 14:57:18 +0200
commit1f95ba000c92cafccea007129d40532a4f35b1a6 (patch)
tree48c7050d7aed4c7879ae8c5231a06087376d4c10 /drivers/net/ethernet/ti/cpsw.c
parentMerge branch 'stmmac-next' (diff)
downloadkernel-qcow2-linux-1f95ba000c92cafccea007129d40532a4f35b1a6.tar.gz
kernel-qcow2-linux-1f95ba000c92cafccea007129d40532a4f35b1a6.tar.xz
kernel-qcow2-linux-1f95ba000c92cafccea007129d40532a4f35b1a6.zip
drivers: net: cpsw: fix suspend when all ethX devices are down
The cpsw_suspend() could trigger L3 error and CPSW will stop functioning if System enters suspend when all ethX net-devices are down - in this case CPSW could be already suspended by PM runtime, but cpsw_suspend() will try to call soft_reset_slave() unconditionally and access CPSW registers. Hence, fix it by moving soft_reset_slave() from cpsw_suspend() to cpsw_slave_stop(). This way slave ports will be reset when CPSW is active and will be in proper state during Suspend. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 9c924f15cd03..6e0f0c6636db 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1243,6 +1243,7 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
slave->phy = NULL;
cpsw_ale_control_set(priv->ale, slave_port,
ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
+ soft_reset_slave(slave);
}
static int cpsw_ndo_open(struct net_device *ndev)
@@ -2548,12 +2549,10 @@ static int cpsw_suspend(struct device *dev)
for (i = 0; i < priv->data.slaves; i++) {
if (netif_running(priv->slaves[i].ndev))
cpsw_ndo_stop(priv->slaves[i].ndev);
- soft_reset_slave(priv->slaves + i);
}
} else {
if (netif_running(ndev))
cpsw_ndo_stop(ndev);
- for_each_slave(priv, soft_reset_slave);
}
pm_runtime_put_sync(&pdev->dev);