aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-06-02 09:13:34 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 09:13:34 -0400
commite3fe8558c7fc182972c3d947d88744482111f304 (patch)
treece78761ef007487fc65d0f0991b2a3925a6b759d /drivers
parentb1011b375be106e0a312baafc981a26165283efe (diff)
net/fec: fix pm to survive to suspend/resume
* in the actual driver, calling fec_stop and fec_enet_init doesn't allow to have a working network interface at resume (where a ifconfig down and up is required to recover the interface) * by using fec_enet_close and fec_enet_open, this patch solves this problem and handle the case where the link changed between suspend and resume * this patch also disable clock at suspend and reenable it at resume Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fec.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index ddf7a86cd466..edfff92a6d8e 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1373,10 +1373,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
1373 1373
1374 if (ndev) { 1374 if (ndev) {
1375 fep = netdev_priv(ndev); 1375 fep = netdev_priv(ndev);
1376 if (netif_running(ndev)) { 1376 if (netif_running(ndev))
1377 netif_device_detach(ndev); 1377 fec_enet_close(ndev);
1378 fec_stop(ndev); 1378 clk_disable(fep->clk);
1379 }
1380 } 1379 }
1381 return 0; 1380 return 0;
1382} 1381}
@@ -1385,12 +1384,13 @@ static int
1385fec_resume(struct platform_device *dev) 1384fec_resume(struct platform_device *dev)
1386{ 1385{
1387 struct net_device *ndev = platform_get_drvdata(dev); 1386 struct net_device *ndev = platform_get_drvdata(dev);
1387 struct fec_enet_private *fep;
1388 1388
1389 if (ndev) { 1389 if (ndev) {
1390 if (netif_running(ndev)) { 1390 fep = netdev_priv(ndev);
1391 fec_enet_init(ndev, 0); 1391 clk_enable(fep->clk);
1392 netif_device_attach(ndev); 1392 if (netif_running(ndev))
1393 } 1393 fec_enet_open(ndev);
1394 } 1394 }
1395 return 0; 1395 return 0;
1396} 1396}