diff options
author | Mugunthan V N <mugunthanvnm@ti.com> | 2014-09-11 13:22:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-13 13:00:05 -0400 |
commit | 618073e30c225ddaef086c030a5f0a3c7ef2d323 (patch) | |
tree | 0a674ba37d9307984a7bc3045a7456e3a82cc298 /drivers/net/ethernet/ti | |
parent | 0bc9b73be43b21838973e80ddeb5250f0310ebf7 (diff) |
drivers: net: cpsw: dual_emac: in suspend/resume bring down/up all the netdev
During suspend and resume in Dual EMAC, second port is not working as in
suspend/resume only the first slave netdev is closed and opened. So bring
down and up all the interfaces that are up during suspend/resume.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 411232f07c3f..e2a00287f8eb 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -2334,10 +2334,19 @@ static int cpsw_suspend(struct device *dev) | |||
2334 | struct net_device *ndev = platform_get_drvdata(pdev); | 2334 | struct net_device *ndev = platform_get_drvdata(pdev); |
2335 | struct cpsw_priv *priv = netdev_priv(ndev); | 2335 | struct cpsw_priv *priv = netdev_priv(ndev); |
2336 | 2336 | ||
2337 | if (netif_running(ndev)) | 2337 | if (priv->data.dual_emac) { |
2338 | cpsw_ndo_stop(ndev); | 2338 | int i; |
2339 | 2339 | ||
2340 | for_each_slave(priv, soft_reset_slave); | 2340 | for (i = 0; i < priv->data.slaves; i++) { |
2341 | if (netif_running(priv->slaves[i].ndev)) | ||
2342 | cpsw_ndo_stop(priv->slaves[i].ndev); | ||
2343 | soft_reset_slave(priv->slaves + i); | ||
2344 | } | ||
2345 | } else { | ||
2346 | if (netif_running(ndev)) | ||
2347 | cpsw_ndo_stop(ndev); | ||
2348 | for_each_slave(priv, soft_reset_slave); | ||
2349 | } | ||
2341 | 2350 | ||
2342 | pm_runtime_put_sync(&pdev->dev); | 2351 | pm_runtime_put_sync(&pdev->dev); |
2343 | 2352 | ||
@@ -2351,14 +2360,24 @@ static int cpsw_resume(struct device *dev) | |||
2351 | { | 2360 | { |
2352 | struct platform_device *pdev = to_platform_device(dev); | 2361 | struct platform_device *pdev = to_platform_device(dev); |
2353 | struct net_device *ndev = platform_get_drvdata(pdev); | 2362 | struct net_device *ndev = platform_get_drvdata(pdev); |
2363 | struct cpsw_priv *priv = netdev_priv(ndev); | ||
2354 | 2364 | ||
2355 | pm_runtime_get_sync(&pdev->dev); | 2365 | pm_runtime_get_sync(&pdev->dev); |
2356 | 2366 | ||
2357 | /* Select default pin state */ | 2367 | /* Select default pin state */ |
2358 | pinctrl_pm_select_default_state(&pdev->dev); | 2368 | pinctrl_pm_select_default_state(&pdev->dev); |
2359 | 2369 | ||
2360 | if (netif_running(ndev)) | 2370 | if (priv->data.dual_emac) { |
2361 | cpsw_ndo_open(ndev); | 2371 | int i; |
2372 | |||
2373 | for (i = 0; i < priv->data.slaves; i++) { | ||
2374 | if (netif_running(priv->slaves[i].ndev)) | ||
2375 | cpsw_ndo_open(priv->slaves[i].ndev); | ||
2376 | } | ||
2377 | } else { | ||
2378 | if (netif_running(ndev)) | ||
2379 | cpsw_ndo_open(ndev); | ||
2380 | } | ||
2362 | return 0; | 2381 | return 0; |
2363 | } | 2382 | } |
2364 | 2383 | ||