aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2011-01-05 16:13:12 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-09 18:42:56 -0500
commitbcc67771ed8ee31cc1f2b1e033ae822b40c72ff9 (patch)
tree1b41ce6cd2fd9f4af71c2bbe2a6084e5c8f0bcd1 /drivers/net/fec.c
parent49da97dcb6b00a6869bbc3fa6ec7fdfd8a6e41a3 (diff)
net/fec: improve pm for better suspend/resume
The following commit made a fix to use fec_enet_open/fec_enet_close over fec_enet_init/fec_stop for suspend/resume, because fec_enet_init does not allow to have a working network interface at resume. e3fe8558c7fc182972c3d947d88744482111f304 net/fec: fix pm to survive to suspend/resume This fix works for i.mx/mxc fec controller, but fails on mx28 fec which gets a different interrupt logic design. On i.mx fec, interrupt can be triggered even bit ETHER_EN of ECR register is not set. But on mx28 fec, ETHER_EN must be set to get interrupt work. Meanwhile, MII interrupt is mandatory to resume the driver, because MDIO read/write changed to interrupt mode by commit below. 97b72e4320a9aaa4a7f1592ee7d2da7e2c9bd349 fec: use interrupt for MDIO completion indication fec_restart/fec_stop comes out as the solution working for both cases. Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 47a3c7b499e9..8a1c51f86414 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1372,8 +1372,10 @@ fec_suspend(struct device *dev)
1372 1372
1373 if (ndev) { 1373 if (ndev) {
1374 fep = netdev_priv(ndev); 1374 fep = netdev_priv(ndev);
1375 if (netif_running(ndev)) 1375 if (netif_running(ndev)) {
1376 fec_enet_close(ndev); 1376 fec_stop(ndev);
1377 netif_device_detach(ndev);
1378 }
1377 clk_disable(fep->clk); 1379 clk_disable(fep->clk);
1378 } 1380 }
1379 return 0; 1381 return 0;
@@ -1388,8 +1390,10 @@ fec_resume(struct device *dev)
1388 if (ndev) { 1390 if (ndev) {
1389 fep = netdev_priv(ndev); 1391 fep = netdev_priv(ndev);
1390 clk_enable(fep->clk); 1392 clk_enable(fep->clk);
1391 if (netif_running(ndev)) 1393 if (netif_running(ndev)) {
1392 fec_enet_open(ndev); 1394 fec_restart(ndev, fep->full_duplex);
1395 netif_device_attach(ndev);
1396 }
1393 } 1397 }
1394 return 0; 1398 return 0;
1395} 1399}